SbloodyS commented on code in PR #3911: URL: https://github.com/apache/incubator-streampark/pull/3911#discussion_r1696885733
########## streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/setting/env/EnvironmentPage.java: ########## @@ -0,0 +1,87 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.streampark.e2e.pages.setting.env; + +import org.apache.streampark.e2e.pages.common.Constants; +import org.apache.streampark.e2e.pages.common.NavBarPage; +import org.apache.streampark.e2e.pages.setting.SettingPage; + +import lombok.Getter; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.remote.RemoteWebDriver; +import org.openqa.selenium.support.FindBy; +import org.openqa.selenium.support.FindBys; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + +import static org.apache.streampark.e2e.pages.common.CommonFactory.WebElementClick; + +@Getter +public class EnvironmentPage extends NavBarPage implements SettingPage.Tab { + + private static final Logger log = LoggerFactory.getLogger(EnvironmentPage.class); + + public EnvironmentPage(RemoteWebDriver driver) { + super(driver); + } + + @FindBys({ + @FindBy(xpath = "//h4[text()='Docker Setting']"), + @FindBy(xpath = "./ancestor::li[@class='ant-list-item']//button[contains(@class, 'ant-btn') and contains(@class, 'ant-btn-primary') and contains(@class, 'ant-btn-circle')]") + }) + private WebElement btnCreateDockerSetting; + + @FindBys({ + @FindBy(xpath = "//h4[text()='Alert Mailbox Setting']"), + @FindBy(xpath = "./ancestor::li[@class='ant-list-item']//button[contains(@class, 'ant-btn') and contains(@class, 'ant-btn-primary') and contains(@class, 'ant-btn-circle')]") + }) + private WebElement btnCreateEmailSetting; + + @FindBy(xpath = "//div[contains(@class, 'system-setting')]") + private List<WebElement> settingList; + + @FindBy(className = "swal2-container") + private List<WebElement> errorMessageList; + + @FindBy(xpath = "//button[contains(@class, 'swal2-confirm') and contains(@class, 'swal2-styled') and text()='OK']") + private WebElement errorMessageConfirmButton; + + public EnvironmentDetailForm createEnvironment(EnvironmentDetailForm.EnvSettingTypeEnum envSettingTypeEnum) { + waitForPageLoading(); + switch (envSettingTypeEnum) { + case Docker: + WebElementClick(driver, btnCreateDockerSetting); + break; + case Email: + WebElementClick(driver, btnCreateEmailSetting); + break; + default: + // ignore Review Comment: It's better throw exception here. ########## streampark-console/streampark-console-webapp/src/views/setting/system/SettingForm.vue: ########## @@ -102,15 +102,13 @@ icon: 'error', title: t('setting.system.update.dockerNotStart'), showConfirmButton: true, - timer: 3500, Review Comment: Why remove this? ########## streampark-e2e/streampark-e2e-case/src/test/resources/docker/environment/docker-compose.yaml: ########## @@ -0,0 +1,62 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +services: + streampark: + image: apache/streampark:ci-basic + command: bash bin/streampark.sh start_docker + build: + context: ./ + dockerfile: ./Dockerfile + ports: + - 10000:10000 + - 10030:10030 + environment: + - SPRING_PROFILES_ACTIVE=h2 + - TZ=Asia/Shanghai + - DOCKER_HOST=tcp://dind:2375 + privileged: true + restart: unless-stopped + networks: + - e2e + volumes: + - ${HOME}/streampark_build_logs:/tmp/streampark/logs/build_logs/ + healthcheck: + test: [ "CMD", "curl", "http://localhost:10000" ] + interval: 5s + timeout: 5s + retries: 120 + + dind: + image: docker:latest + privileged: true + environment: + - DOCKER_TLS_CERTDIR=/certs + command: ["dockerd", "--host=tcp://0.0.0.0:2375"] + volumes: + - dind-certs:/certs + - dind-var-lib-docker:/var/lib/docker + ports: + - "2375:2375" + networks: + - e2e Review Comment: We don't need this since we already have docker in docker in the default image. We just need a simple mount local docker to container. You can refer to https://github.com/apache/incubator-streampark/blob/1c3b89095d6eec6ac6f28078c66d8f7f60db1d2e/docker/docker-compose.yaml#L33-L36 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
