Java JiraLoginPage Example

Introduction

The java jiraloginpage example is extracted from the most popular open source projects, you can refer to the following example for usage.

Programming language: Java

Namespace/package name: it.servicedesk.pageobjects

Example#1
File: TestGoogleAuthentication.javaProject: tuyndv/social-authentication-for-atlassian

  @Test
  @LoginAs(anonymous = true)
  public void testLogInWithinAllowedDomainsWork()
      throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
    JiraLoginPage loginPage = jira.visit(JiraLoginPage.class);
    Poller.waitUntilTrue(loginPage.isOpenIdButtonVisible());
    loginPage.startAuthenticationDanceFor("Google");

    loginDance(
        (String) getProperty(passwords, "teamstatus.user"),
        (String) getProperty(passwords, "teamstatus.password"));

    jira.getPageBinder().bind(DashboardPage.class);
  }

Example#2
File: TestGoogleAuthentication.javaProject: tuyndv/social-authentication-for-atlassian

  @Test
  @LoginAs(anonymous = true)
  public void testLogInOutsideAllowedDomainsIsProhibited()
      throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
    JiraLoginPage loginPage = jira.visit(JiraLoginPage.class);
    Poller.waitUntilTrue(loginPage.isOpenIdButtonVisible());
    loginPage.startAuthenticationDanceFor("Google");

    loginDance(
        (String) getProperty(passwords, "gmail.user"),
        (String) getProperty(passwords, "gmail.password"));

    ErrorPage errorPage = jira.getPageBinder().bind(ErrorPage.class);
    Poller.waitUntil(errorPage.getErrorMessage(), containsString("allowed domains"));
  }

Example#3
File: TestGoogleAuthentication.javaProject: tuyndv/social-authentication-for-atlassian

  @Test
  @LoginAs(anonymous = true)
  public void testLogInRedirectsToReturnUrl()
      throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
    jira.getTester()
        .getDriver()
        .navigate()
        .to(
            jira.getProductInstance().getBaseUrl()
                + "/login.jsp?os_destination=%2Fsecure%2FViewProfile.jspa");
    JiraLoginPage loginPage = jira.getPageBinder().bind(JiraLoginPage.class);
    Poller.waitUntilTrue(loginPage.isOpenIdButtonVisible());
    loginPage.startAuthenticationDanceFor("Google");

    loginDance(
        (String) getProperty(passwords, "teamstatus.user"),
        (String) getProperty(passwords, "teamstatus.password"));

    jira.getPageBinder().bind(ViewProfilePage.class);
  }