SbloodyS commented on code in PR #3899: URL: https://github.com/apache/incubator-streampark/pull/3899#discussion_r1687370699
########## streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/AlarmTest.java: ########## @@ -0,0 +1,154 @@ +/* + * 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.cases; + +import org.apache.streampark.e2e.core.StreamPark; +import org.apache.streampark.e2e.pages.LoginPage; +import org.apache.streampark.e2e.pages.setting.SettingPage; +import org.apache.streampark.e2e.pages.setting.alarm.AlarmPage; +import org.apache.streampark.e2e.pages.setting.alarm.AlertTypeDetailForm; +import org.apache.streampark.e2e.pages.setting.alarm.DingTalkAlertForm; +import org.apache.streampark.e2e.pages.setting.alarm.EmailAlertForm; +import org.apache.streampark.e2e.pages.setting.alarm.LarkAlertForm; +import org.apache.streampark.e2e.pages.setting.alarm.WeChatAlertForm; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.remote.RemoteWebDriver; +import org.testcontainers.shaded.org.awaitility.Awaitility; + +import static org.assertj.core.api.Assertions.assertThat; + +@StreamPark(composeFiles = "docker/basic/docker-compose.yaml") +public class AlarmTest { + + private static RemoteWebDriver browser; + + private static final String userName = "admin"; + + private static final String password = "streampark"; + + private static final String teamName = "default"; + + private static final String newEmail = "[email protected]"; + + private static final String newAlarmName = "new_alarm"; + + private static final String editAlarmName = "edit_alarm"; + + @BeforeAll + public static void setup() { + new LoginPage(browser) + .login(userName, password, teamName) + .goToNav(SettingPage.class) + .goToTab(AlarmPage.class); + } + + @Test + @Order(10) + public void testCreateAlarm() { + final AlarmPage alarmPage = new AlarmPage(browser); + + final String dingTalkURL = ""; + final String dingTalkToken = "dingTalkToken"; + final String dingTalkSecretToken = "dingTalkSecretToken"; + final String dingTalkReceiveUser = "dingTalkUser"; + + final String wechatToken = "wechatToken"; + + final String larkToken = "larkToken"; + final String larkSecretToken = "larkSecretToken"; + + alarmPage.createAlarm() + .<EmailAlertForm>addAlertType(AlertTypeDetailForm.AlertTypeEnum.EMAIL) + .email(newEmail) + .alertName(newAlarmName) + .parent() Review Comment: We don't need this `parent()` since these operations are in the same page. -- 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]
