0.0.13 • Published 4 years ago

cypress-e2e-login v0.0.13

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
4 years ago

cypress-e2e-login

Installation:

npm i --save-dev cypress-e2e-login puppeteer

Note: You must have access to Apollo Artifacts before you can download this package.

Importing the plugin:

In /cypress/support/index.js (at the top):

import "cypress-e2e-login/support/commands" 

In /cypress/plugins/index.js:

const cypressLogin  = require("cypress-e2e-login/plugins/index");

 module.exports = (on, config) => {
    cypressLogin(on, config);
};

At last, you need to add the following to your cypress.json config and replace the variables with the correct values:

 "env": {
    "HOST": "survey.dev.farmonline.cloud",
    "USERNAME": "cypress-test-user@farmonline.onmicrosoft.com",
    "PASSWORD": "test123",
    "auth_base_url": "https://login.my-apollo.cloud",
    "auth_realm": "apollo",
    "auth_client_id": "apl_edgedeviceservice_ui"
  },

Usage:

beforeEach(() => {
    cy.loginSkov(username, password, baseUrl);
});

Based on https://gitlab.com/apollo-cloud/smoke-tests by Polina Tagirova.