PromucFlow_constructor/app/client/cypress/support/index.js
devrk96 539253f17e
Feature: Create new-app flow (#926)
* create new app flow

* uncontrolled component error fixed

* loader added when user is deleting or user role is updating

* home page loader and create-new-app loader added

* user role changing and use deleting state fixed

* PR feeback changes added

* orgname loader added

* warnings removed

* fixed create-new-app flow and delete app test cases

* beforeAll test case condition fixed

* Initial navigation condition fixed in createOrg test cases

* app card loading state fixed
2020-10-14 16:05:19 +05:30

69 lines
1.7 KiB
JavaScript

// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
require("cypress-xpath");
let pageid;
let appId;
// Import commands.js using ES2015 syntax:
import "./commands";
Cypress.on("uncaught:exception", (err, runnable) => {
// returning false here prevents Cypress from
// failing the test
return false;
});
Cypress.on("fail", (error, runnable) => {
debugger;
throw error; // throw error to have test still fail
return false;
});
before(function() {
cy.startServerAndRoutes();
const username = Cypress.env("USERNAME");
const password = Cypress.env("PASSWORD");
cy.LoginFromAPI(username, password);
cy.visit("/applications");
cy.wait("@applications").should(
"have.nested.property",
"response.body.responseMeta.status",
200,
);
cy.generateUUID().then(id => {
appId = id;
cy.CreateApp(id);
cy.EditApp(id);
localStorage.setItem("AppName", appId);
});
cy.fixture("example").then(function(data) {
this.data = data;
});
});
beforeEach(function() {
Cypress.Cookies.preserveOnce("SESSION", "remember_token");
cy.startServerAndRoutes();
});
after(function() {
//-- Deleting the application by Api---//
cy.DeleteAppByApi();
//-- LogOut Application---//
cy.LogOut();
});