package.cjs.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.
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.authUtils = void 0;
var _navigation = require("./navigation");
var _common = require("../constants/selectors/common");
var _login = require("../constants/selectors/login");
var _common2 = require("../constants/texts/common");
var verifySSOLoginPage = function verifySSOLoginPage() {
cy.log("verify Login Page");
cy.get(_login.loginSelectors.githubAuthenticationButton).should("be.visible");
cy.get(_login.loginSelectors.twitterAuthenticationButton).should("be.visible");
cy.get(_login.loginSelectors.appleAuthenticationButton).should("be.visible");
cy.get(_login.loginSelectors.googleAuthenticationButton).should("be.visible");
cy.log("verify Cross Site scripting");
cy.clearAndType(_login.loginSelectors.emailTextField, _common2.commonTexts.crossSiteScript);
cy.get(_login.loginSelectors.submitButton).click();
cy.get(_common.commonSelectors.windowAlert).should("not.exist");
cy.log("verify email login");
cy.get(_common.commonSelectors.emailInputError).should("have.text", _common2.commonTexts.invalidEmailMessage);
cy.get(_login.loginSelectors.emailTextField).clear();
cy.get(_login.loginSelectors.submitButton).click();
cy.get(_common.commonSelectors.emailInputError).should("have.text", _common2.commonTexts.invalidEmailMessage);
};
var logout = function logout(homeUrl) {
cy.get(_common.profileSelectors.loader).should("not.exist");
_navigation.navigationUtils.openProfileOrHelpCenter({
tabSelector: _common.profileSelectors.tab,
subTabLink: _common.profileSelectors.logoutLink,
count: 5
});
cy.get(_common.profileSelectors.tab).click();
cy.get(_common.profileSelectors.logoutLink).should("have.text", _common2.commonTexts.logout).invoke("click");
cy.url({
timeout: 15000
}).should("not.include", homeUrl);
};
var authUtils = {
verifySSOLoginPage: verifySSOLoginPage,
logout: logout
};
exports.authUtils = authUtils;
//# sourceMappingURL=authentication.js.map