All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.cypress-utils.utils.authentication.js Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
import { navigationUtils } from "./navigation";
import { commonSelectors, profileSelectors } from "../constants/selectors/common";
import { loginSelectors } from "../constants/selectors/login";
import { commonTexts } from "../constants/texts/common";
var verifySSOLoginPage = function verifySSOLoginPage() {
  cy.log("verify Login Page");
  cy.get(loginSelectors.githubAuthenticationButton).should("be.visible");
  cy.get(loginSelectors.twitterAuthenticationButton).should("be.visible");
  cy.get(loginSelectors.appleAuthenticationButton).should("be.visible");
  cy.get(loginSelectors.googleAuthenticationButton).should("be.visible");
  cy.log("verify Cross Site scripting");
  cy.clearAndType(loginSelectors.emailTextField, commonTexts.crossSiteScript);
  cy.get(loginSelectors.submitButton).click();
  cy.get(commonSelectors.windowAlert).should("not.exist");
  cy.log("verify email login");
  cy.get(commonSelectors.emailInputError).should("have.text", commonTexts.invalidEmailMessage);
  cy.get(loginSelectors.emailTextField).clear();
  cy.get(loginSelectors.submitButton).click();
  cy.get(commonSelectors.emailInputError).should("have.text", commonTexts.invalidEmailMessage);
};
var logout = function logout(homeUrl) {
  cy.get(profileSelectors.loader).should("not.exist");
  navigationUtils.openProfileOrHelpCenter({
    tabSelector: profileSelectors.tab,
    subTabLink: profileSelectors.logoutLink,
    count: 5
  });
  cy.get(profileSelectors.tab).click();
  cy.get(profileSelectors.logoutLink).should("have.text", commonTexts.logout).invoke("click");
  cy.url({
    timeout: 15000
  }).should("not.include", homeUrl);
};
export var authUtils = {
  verifySSOLoginPage: verifySSOLoginPage,
  logout: logout
};
//# sourceMappingURL=authentication.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy