package.cypress-utils.utils.authentication.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
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