Asserts the current screen is the login page.

@throws ExpectationException
177819
protected function verifyLoginPage()
    {

        // Get the session.
        $session = $this->verifySession();

        // Get the url.
        $url = $session->getCurrentUrl();

        // If the login path isn't in the current URL.
        if (false === strrpos($url, $this->path)) {
            // We aren't on the login screen.
            throw new ExpectationException(
                sprintf(
                    'Expected screen is the wp-login form, instead on "%1$s".',
                    $url
                ),
                $this->getDriver()
            );
        }

        // Get the page.
        $page = $session->getPage();

        // Login form CSS selector
        $login_form_selector = '#loginform';

        // Search for the login form exists.
        $login_form = $page->find('css', $login_form_selector);

        // If the login form was not found.
        if (null === $login_form) {
            // We aren't on the login screen.
            throw new ExpectationException(
                sprintf(
                    'Expected to find the login form with the selector "%1$s" at the current URL "%2$s".',
                    $login_form_selector,
                    $url
                ),
                $this->getDriver()
            );
        }
    }
679175
public static Expectations successfullyReachedFormLoginPage(String testAction) {
        Expectations expectations = successfullyReachedLoginPage(testAction);
        expectations.addExpectation(new ResponseFullExpectation(testAction, Constants.STRING_CONTAINS, Constants.FORM_LOGIN_HEADING, "Page returned during test step " + testAction + " did not match expected value."));
        return expectations;
    }
1120518
public ScreenModel checkSecurity(ScreenModel screen, ScreenModel parentScreen)
    {
        int iErrorCode = DBConstants.NORMAL_RETURN;
        if (screen != null)
            iErrorCode = ((BaseScreen)screen).checkSecurity();
        if (iErrorCode == Constants.READ_ACCESS)
        {
            ((BaseScreen)screen).setEditing(false);
            ((BaseScreen)screen).setAppending(false);
            iErrorCode = DBConstants.NORMAL_RETURN;
        }
        if (iErrorCode == DBConstants.NORMAL_RETURN)
            return screen;    // Good, access allowed
        else
        {
            if (screen != null)
                screen.free();
            return this.getSecurityScreen(iErrorCode, (BasePanel)parentScreen);  // Create and return the login or error screen
        }
    }
141722
public function iClickOn($element)
    {
        $page = $this->getSession()->getPage();
        $findName = $page->find("css", $element);

        if (!$findName) {
            throw new ExpectationException(
                $element . " could not be found",
                $this->getSession()->getDriver()
            );
        }

        $findName->click();
    }
1119038
protected function validateExpectationOrThrowException(Expectation $expectation, LoggerInterface $logger)
    {
        $this->validateRequestOrThrowException($expectation, $logger);
        $this->validateResponseOrThrowException($expectation, $logger);
        $this->validateScenarioConfigOrThrowException($expectation, $logger);
    }
232730
public function logIn(string $username, string $password, string $redirect_to = '/')
    {
        if ($this->loggedIn()) {
            $this->logOut();
        }

        // Start a session.
        $session = $this->getSession();

        // Go to the login form.
        $this->visitPath('wp-login.php?redirect_to=' . urlencode($this->locatePath($redirect_to)));

        // Fill in username.
        $this->login_page->setUserName($username);

        // Fill in password.
        $this->login_page->setUserPassword($password);

        // Submit the login form.
        $this->login_page->submitLoginForm();

        if (! $this->loggedIn()) {
            throw new ExpectationException('[W803] The user could not be logged-in.', $this->getSession()->getDriver());
        }
    }
473609
public static void assertCauseMessage(final Throwable ex, final String expectedMessage) {
        assertThat(ex.getCause()).isNotNull();
        assertThat(ex.getCause().getMessage()).isEqualTo(expectedMessage);
    }
733118
public function verify()
    {
        if ($this->groupIndex < $this->sequenceIndex) {
            throw new PHPUnit_Framework_ExpectationFailedException(
              sprintf(
                "The expected invocation at method '%s' group-index %d was never reached.",

                $this->method,
                $this->sequenceIndex
              )
            );
        }
    }
259504
public static Expectations successfullyReachedLoginPage(String testAction) {
        Expectations expectations = new Expectations();
        expectations.addSuccessStatusCodesForActions(new String[] { testAction });
        expectations.addExpectation(new ResponseTitleExpectation(testAction, Constants.STRING_EQUALS, Constants.FORM_LOGIN_TITLE, "Title of page returned during test step " + testAction
                + " did not match expected value."));
        return expectations;
    }
895087
private void assertState(StandbyIngestState... expectedStates)
      throws IOException {
    for (StandbyIngestState s : expectedStates) {
      if (currentIngestState == s)
        return;
    }
    throw new IOException("Standby: illegal state - current: "
        + currentIngestState);
  }
211596
public void initPage() throws CmsException {

        if ((m_page == null) && (m_cms != null)) {
            String requestUri = m_cms.getRequestContext().getUri();
            // get the container page itself, checking the history first
            CmsResource pageResource = (CmsResource)CmsHistoryResourceHandler.getHistoryResource(m_request);
            if (pageResource == null) {
                pageResource = m_cms.readResource(requestUri);
            }
            m_page = getPage(pageResource);
            m_page = CmsTemplateMapper.get(m_request).transformContainerpageBean(
                m_cms,
                m_page,
                pageResource.getRootPath());

        }
    }
675588
public static Expectations successfullyReachedProtectedResourceWithJwtCookie(String testAction, String protectedUrl, String username, String issuerRegex) {
        Expectations expectations = new Expectations();
        expectations.addExpectations(successfullyReachedUrl(testAction, protectedUrl));
        expectations.addExpectations(getResponseTextExpectationsForJwtCookie(testAction, JwtFatConstants.JWT_COOKIE_NAME, username));
        expectations.addExpectations(getJwtPrincipalExpectations(testAction, username, issuerRegex));
        return expectations;
    }
564520
public void init(RecordOwner screen)
    {
        m_recDetail = null;
        m_recDetailChildren = null;
        m_recProjectTaskPredecessor = null;
        super.init(screen);
    }
1027863
protected void checkAlert(Page page) throws FailureException {
        if (!DriverFactory.IE.equals(Context.getBrowser())) {
            final String txt = getAlertMessage();
            if (txt != null) {
                new Result.Failure<>(txt, Messages.getMessage(Messages.FAIL_MESSAGE_ALERT_FOUND), true, page.getCallBack());
            }
        } else {
            Context.getCurrentScenario().write("SKIPPED for Internet Explorer browser.");
        }
    }
1072093
public static Expectations ltpaCookieExists(String testAction, WebClient webClient) {
        Expectations expectations = new Expectations();
        expectations.addExpectation(new CookieExpectation(testAction, webClient, JwtFatConstants.LTPA_COOKIE_NAME, ".+"));
        return expectations;
    }
452300
private void error(PageException pe) {
	if (error == null) throw new PageRuntimeException(pe);
	try {
	    pc = ThreadLocalPageContext.get(pc);
	    error.call(pc, new Object[] { pe.getCatchBlock(pc.getConfig()) }, false);
	}
	catch (PageException e) {}
    }
72912
@Override
    public int doEndTag() throws JspException {
        try {
            conn.commit();
        } catch (SQLException e) {
            throw new JspTagException(
                    Resources.getMessage("TRANSACTION_COMMIT_ERROR",
                            e.toString()), e);
        }
        return EVAL_PAGE;
    }