2019-12-12 07:50:53 +00:00
|
|
|
// ***********************************************************
|
|
|
|
|
// 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
|
|
|
|
|
// ***********************************************************
|
2020-04-02 04:47:48 +00:00
|
|
|
require("cypress-xpath");
|
2020-03-27 09:02:11 +00:00
|
|
|
const loginData = require("../fixtures/user.json");
|
|
|
|
|
const inputData = require("../fixtures/inputdata.json");
|
2020-05-01 07:48:33 +00:00
|
|
|
let pageid;
|
2020-05-05 09:08:31 +00:00
|
|
|
let appId;
|
2020-03-20 14:21:24 +00:00
|
|
|
|
2019-12-12 07:50:53 +00:00
|
|
|
// Import commands.js using ES2015 syntax:
|
2020-03-27 09:02:11 +00:00
|
|
|
import "./commands";
|
2020-06-17 10:47:01 +00:00
|
|
|
|
|
|
|
|
Cypress.on("uncaught:exception", (err, runnable) => {
|
|
|
|
|
// returning false here prevents Cypress from
|
|
|
|
|
// failing the test
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
2020-03-27 09:02:11 +00:00
|
|
|
before(function() {
|
2020-05-12 19:59:36 +00:00
|
|
|
console.log("**** Got Cypress base URL as: ", process.env.CYPRESS_BASE_URL);
|
2020-05-27 11:21:11 +00:00
|
|
|
cy.startServerAndRoutes();
|
2020-06-19 14:32:56 +00:00
|
|
|
//cy.LogintoApp(loginData.username, loginData.password);
|
2020-07-11 06:42:53 +00:00
|
|
|
cy.LoginFromAPI(Cypress.env("username"), Cypress.env("password"));
|
2020-06-17 10:47:01 +00:00
|
|
|
cy.visit("/applications");
|
|
|
|
|
cy.wait("@applications").should(
|
|
|
|
|
"have.nested.property",
|
|
|
|
|
"response.body.responseMeta.status",
|
|
|
|
|
200,
|
|
|
|
|
);
|
2020-06-19 14:32:56 +00:00
|
|
|
|
2020-05-05 09:08:31 +00:00
|
|
|
cy.generateUUID().then(id => {
|
|
|
|
|
appId = id;
|
|
|
|
|
cy.CreateApp(id);
|
2020-05-20 11:04:39 +00:00
|
|
|
localStorage.setItem("AppName", appId);
|
2020-05-05 09:08:31 +00:00
|
|
|
});
|
2020-05-12 13:47:13 +00:00
|
|
|
|
2020-06-19 14:32:56 +00:00
|
|
|
/*
|
2020-05-01 07:48:33 +00:00
|
|
|
cy.generateUUID().then(uid => {
|
|
|
|
|
pageid = uid;
|
|
|
|
|
cy.Createpage(pageid);
|
|
|
|
|
cy.NavigateToWidgets(pageid);
|
2020-05-21 09:45:48 +00:00
|
|
|
localStorage.setItem("PageName", pageid);
|
2020-05-01 07:48:33 +00:00
|
|
|
});
|
2020-06-19 14:32:56 +00:00
|
|
|
*/
|
2020-05-08 09:01:11 +00:00
|
|
|
cy.fixture("example").then(function(data) {
|
|
|
|
|
this.data = data;
|
|
|
|
|
});
|
2020-05-11 10:38:49 +00:00
|
|
|
});
|
2020-05-08 09:01:11 +00:00
|
|
|
|
2020-05-11 10:38:49 +00:00
|
|
|
beforeEach(function() {
|
|
|
|
|
Cypress.Cookies.preserveOnce("SESSION", "remember_token");
|
2020-05-27 11:21:11 +00:00
|
|
|
cy.startServerAndRoutes();
|
2020-05-11 10:38:49 +00:00
|
|
|
});
|
2019-12-12 07:50:53 +00:00
|
|
|
|
2020-05-11 10:38:49 +00:00
|
|
|
after(function() {
|
|
|
|
|
// ---commenting Publish app and Delete page as of now--- //
|
2020-05-12 04:35:21 +00:00
|
|
|
//cy.Deletepage(pageid);
|
2020-05-11 10:38:49 +00:00
|
|
|
//cy.PublishtheApp();
|
2020-05-12 04:35:21 +00:00
|
|
|
//-- Deleting the application by Api---//
|
|
|
|
|
cy.DeleteAppByApi();
|
2020-05-19 06:13:15 +00:00
|
|
|
//-- LogOut Application---//
|
|
|
|
|
cy.LogOut();
|
2020-03-27 09:02:11 +00:00
|
|
|
});
|