Skip to content

Commit

Permalink
update cypress configs
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Sep 21, 2022
1 parent a2aa572 commit 21bd19b
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 87 deletions.
24 changes: 24 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
viewportWidth: 1280,
defaultCommandTimeout: 8888,
chromeWebSecurity: false,
reporter: "junit",
video: true,
retries: {
runMode: 8,
openMode: 0,
},
reporterOptions: {
mochaFile: "cypress/reports/cypress-[hash].xml",
jenkinsMode: true,
toConsole: true,
},
e2e: {
setupNodeEvents(on, config) {
// e2e testing node events setup code
},
baseUrl: "http://localhost:3000",
},
});
17 changes: 0 additions & 17 deletions cypress.json

This file was deleted.

44 changes: 44 additions & 0 deletions cypress/e2e/block-basics.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { setupBeforeEach, tearDownAfterEach } from "../support/e2e";

describe("Blocks Tests", () => {
beforeEach(setupBeforeEach);
afterEach(tearDownAfterEach);

it("Add Block: Empty", () => {
// without this the clear command below does nothing sometimes
cy.wait(500);

// Change page title
cy.get("[contenteditable=true]").first().clear();

cy.get("[contenteditable=true]").first().type("My Add-on Page");

cy.get(".documentFirstHeading").contains("My Add-on Page");

cy.get("[contenteditable=true]").first().type("{enter}");

// Add block
cy.get(".ui.basic.icon.button.block-add-button").first().click();
cy.get(".blocks-chooser .title").contains("Common").click();
cy.get(".content.active.common .button.listing")
.contains("Listing")
.click();

// Select Custom summary Variation
cy.get("#field-variation").click().contains("Cards gallery").click();
cy.get(".query-widget #field-query-0-querystring").click();
cy.get(".react-select__menu").contains("Creator").first().click();
cy.get(".field.query-sort-on-widget #select-listingblock-sort-on").click();
cy.get(".react-select__menu").contains("Creator").click();

// Test for switches
cy.contains("Gallery").click();

// Save
cy.get("#toolbar-save").click();
cy.url().should("eq", Cypress.config().baseUrl + "/cypress/my-page");

// then the page view should contain our changes
cy.contains("My Add-on Page");
});
});
44 changes: 0 additions & 44 deletions cypress/integration/block-basics.js

This file was deleted.

26 changes: 0 additions & 26 deletions cypress/plugins/index.js

This file was deleted.

File renamed without changes.

0 comments on commit 21bd19b

Please sign in to comment.