We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have the following Performable:
public static Performable asAdministrator(String url, String username, String password) { return Task.where( "{0} logs in as " + username, Open.url(url), Click.on(HomePage.homePageLoginButtonXPath()).afterWaitingUntilEnabled(), Enter.theValue(username).into(LoginPage.loginPageUserNameXPath()), Enter.theValue(password).into(LoginPage.loginPagePasswordXPath()), Click.on(LoginPage.xPathForHomePageLoginButton()) ); }
And using it in this test:
@Test @DisplayName("The user can successfully login with the correct credentials") void userCanLoginSuccessfully() { administrator.attemptsTo( // Open.url("https://osh-preprod.oneapihub.com/"), // Click.on(HomePage.homePageLoginButtonXPath()), // Enter.theValue(username).into(LoginPage.loginPageUserNameXPath()), // Enter.theValue(password).into(LoginPage.loginPagePasswordXPath()), // Click.on(LoginPage.loginPageLoginButtonXPath()) Login.asAdministrator(rootUrl, username, password) ); String contentHeaderTitle = administrator.asksFor(Text.of("//h4[@id='content-header-title']")); Assertions.assertNotNull(contentHeaderTitle); Serenity.reportThat("The User is greeted with a welcome message", () -> Assertions.assertTrue(contentHeaderTitle.contains("Welcome")) ); }
It tells me it can't find the login button element.
However if I uncomment the code and remove the call to the performable, this works.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have the following Performable:
public static Performable asAdministrator(String url, String username, String password) { return Task.where( "{0} logs in as " + username, Open.url(url), Click.on(HomePage.homePageLoginButtonXPath()).afterWaitingUntilEnabled(), Enter.theValue(username).into(LoginPage.loginPageUserNameXPath()), Enter.theValue(password).into(LoginPage.loginPagePasswordXPath()), Click.on(LoginPage.xPathForHomePageLoginButton()) ); }
And using it in this test:
@Test @DisplayName("The user can successfully login with the correct credentials") void userCanLoginSuccessfully() { administrator.attemptsTo( // Open.url("https://osh-preprod.oneapihub.com/"), // Click.on(HomePage.homePageLoginButtonXPath()), // Enter.theValue(username).into(LoginPage.loginPageUserNameXPath()), // Enter.theValue(password).into(LoginPage.loginPagePasswordXPath()), // Click.on(LoginPage.loginPageLoginButtonXPath()) Login.asAdministrator(rootUrl, username, password) ); String contentHeaderTitle = administrator.asksFor(Text.of("//h4[@id='content-header-title']")); Assertions.assertNotNull(contentHeaderTitle); Serenity.reportThat("The User is greeted with a welcome message", () -> Assertions.assertTrue(contentHeaderTitle.contains("Welcome")) ); }
It tells me it can't find the login button element.
However if I uncomment the code and remove the call to the performable, this works.
The text was updated successfully, but these errors were encountered: