This is an automated email from the ASF dual-hosted git repository. liuxun pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/submarine.git
The following commit(s) were added to refs/heads/master by this push: new 723fb36 SUBMARINE-440. [E2E_Test] Test Login page 723fb36 is described below commit 723fb36cfb859c6aa2719546b31cbccc2c96c53a Author: kobe860219 <kobe860...@gmail.com> AuthorDate: Thu Mar 19 14:16:29 2020 +0800 SUBMARINE-440. [E2E_Test] Test Login page ### What is this PR for? Add more tests to ensure the reliability of Login page. (1) Enter invalid username and password (2) Blank username and password ### What type of PR is it? Improvement ### Todos * [ ] - Task ### What is the Jira issue? https://issues.apache.org/jira/browse/SUBMARINE-440 ### How should this be tested? https://travis-ci.org/github/apache/submarine/builds/664263153?utm_source=github_status&utm_medium=notification ### Screenshots (if appropriate) ![image](https://user-images.githubusercontent.com/48027290/77038191-11346200-69ee-11ea-940e-0535cf93f63e.png) ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: kobe860219 <kobe860...@gmail.com> Closes #239 from kobe860219/SUBMARINE-440 and squashes the following commits: 4eadf4a [kobe860219] SUBMARINE-440. [E2E_Test] Test Login page --- .../java/org/apache/submarine/integration/loginIT.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/loginIT.java b/submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/loginIT.java index 67a86c5..e7809d2 100644 --- a/submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/loginIT.java +++ b/submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/loginIT.java @@ -25,6 +25,7 @@ import org.slf4j.LoggerFactory; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +import org.testng.Assert; public class loginIT extends AbstractSubmarineIT { public final static Logger LOG = LoggerFactory.getLogger(loginIT.class); @@ -44,6 +45,22 @@ public class loginIT extends AbstractSubmarineIT { @Test public void loginUser() throws Exception { + // Testcase1 + LOG.info("[Sub-Testcase-1] Invalid User"); + LOG.info("Enter blank username and password"); + clickAndWait(By.cssSelector("button[class='login-form-button ant-btn ant-btn-primary']")); + Assert.assertEquals( driver.findElements(By.xpath("//div[contains(text(), \"Please input your username!\")]")).size(), 1); + Assert.assertEquals( driver.findElements(By.xpath("//div[contains(text(), \"Please input your Password!\")]")).size(), 1); + LOG.info("Enter invalid username and password"); + pollingWait(By.cssSelector("input[ng-reflect-name='userName']"), MAX_BROWSER_TIMEOUT_SEC).sendKeys("123"); + pollingWait(By.cssSelector("input[ng-reflect-name='password']"), MAX_BROWSER_TIMEOUT_SEC).sendKeys("123"); + clickAndWait(By.cssSelector("button[class='login-form-button ant-btn ant-btn-primary']")); + Assert.assertEquals( driver.findElements(By.xpath("//div[contains(text(), \"_this.logError is not a function\")]")).size(), 1); + pollingWait(By.cssSelector("input[ng-reflect-name='userName']"), MAX_BROWSER_TIMEOUT_SEC).sendKeys("\b\b\b"); + pollingWait(By.cssSelector("input[ng-reflect-name='password']"), MAX_BROWSER_TIMEOUT_SEC).sendKeys("\b\b\b"); + + // Testcase2 + LOG.info("[Sub-Testcase-2] Valid User"); LOG.info("Start to login user to submarine workbench."); pollingWait(By.cssSelector("input[ng-reflect-name='userName']"), MAX_BROWSER_TIMEOUT_SEC).sendKeys("admin"); pollingWait(By.cssSelector("input[ng-reflect-name='password']"), MAX_BROWSER_TIMEOUT_SEC).sendKeys("admin"); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@submarine.apache.org For additional commands, e-mail: dev-h...@submarine.apache.org