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-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";
|
2021-07-02 06:04:36 +00:00
|
|
|
import { initLocalstorage } from "./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-07-24 04:31:39 +00:00
|
|
|
Cypress.on("fail", (error, runnable) => {
|
|
|
|
|
debugger;
|
|
|
|
|
throw error; // throw error to have test still fail
|
|
|
|
|
});
|
|
|
|
|
|
2020-03-27 09:02:11 +00:00
|
|
|
before(function() {
|
2021-07-02 06:04:36 +00:00
|
|
|
initLocalstorage();
|
2020-05-27 11:21:11 +00:00
|
|
|
cy.startServerAndRoutes();
|
2021-01-04 10:22:22 +00:00
|
|
|
// Clear indexedDB
|
|
|
|
|
cy.window().then((window) => {
|
|
|
|
|
window.indexedDB.deleteDatabase("Appsmith");
|
|
|
|
|
});
|
2021-07-02 06:04:36 +00:00
|
|
|
|
2020-07-16 05:50:46 +00:00
|
|
|
const username = Cypress.env("USERNAME");
|
|
|
|
|
const password = Cypress.env("PASSWORD");
|
|
|
|
|
cy.LoginFromAPI(username, 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
|
|
|
|
2021-01-04 10:22:22 +00:00
|
|
|
cy.generateUUID().then((id) => {
|
2020-05-05 09:08:31 +00:00
|
|
|
appId = id;
|
2021-02-04 11:31:32 +00:00
|
|
|
cy.CreateAppInFirstListedOrg(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-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() {
|
2021-07-02 06:04:36 +00:00
|
|
|
initLocalstorage();
|
2020-05-11 10:38:49 +00:00
|
|
|
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() {
|
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
|
|
|
});
|