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

package.cjs.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
"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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy