Skip to content

Commit

Permalink
update cypress test with new classes and test template page title and…
Browse files Browse the repository at this point in the history
… content more generally
  • Loading branch information
circlecube committed Sep 6, 2023
1 parent a154689 commit c948701
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions tests/cypress/integration/coming-soon.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ describe('Coming Soon', function () {
.should('be.visible');
cy.get('.nfd-notifications').contains('.nfd-notification', 'Coming soon activated').should('be.visible');

// Protip was removed in redesign, should reimplement
// cy
// .get('.coming-soon-protip .accordion-summary')
// .contains('p', 'Pro Tip')
// .should('be.visible');
// cy.get('.coming-soon-protip').should('not.have.attr', 'open');
// cy.get('.coming-soon-protip summary').click();
// cy.wait(100);
// cy.get('.coming-soon-protip').should('have.attr', 'open');
});

it('Displays Coming Soon in Site Status Admin Toolbar', () => {
Expand All @@ -72,16 +63,16 @@ describe('Coming Soon', function () {

it('Has Coming Soon Section on Home', () => {
cy.visit('/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/home');
cy.get( appClass + '-home .wppb-app-section-content').first()
cy.get( appClass + '-home .nfd-app-section-content').first()
.scrollIntoView()
.contains('h1', 'Ready to go live?')
.should('be.visible');

cy.get( appClass + '-home .wppb-app-section-content')
cy.get( appClass + '-home .nfd-app-section-content')
.contains('a.nfd-button', 'Preview your').first()
.should('exist');

cy.get( appClass + '-home .wppb-app-section-content').first()
cy.get( appClass + '-home .nfd-app-section-content').first()
.contains('button', 'Launch your')
.should('exist');

Expand All @@ -97,9 +88,8 @@ describe('Coming Soon', function () {
it('Displays Coming Soon on Frontend', () => {
cy.logout();
cy.visit('/');
cy.get('body')
.contains('h1', 'Coming')
.should('be.visible');
cy.title().should('include', 'Coming Soon');
cy.get('#wrap').contains('Coming Soon').should('exist');
});

it('Launching launches site', () => {
Expand All @@ -109,20 +99,19 @@ describe('Coming Soon', function () {

cy.visit('/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/home');

cy.get( appClass + '-home .wppb-app-section-content').first()
cy.get( appClass + '-home .nfd-app-section-content').first()
.contains('button', 'Launch your')
.click();
cy.wait(100);

cy.get( appClass + '-home .wppb-app-section-content').first()
cy.get( appClass + '-home .nfd-app-section-content').first()
.contains('button', 'Launch your')
.should('not.exist');

cy.logout();
cy.visit('/');
cy.get('body')
.contains('h1', 'Coming soon')
.should('not.exist');
cy.title().should('not.include', 'Coming Soon');
cy.get('body').contains('Coming Soon').should('not.exist');

cy.login(Cypress.env('wpUsername'), Cypress.env('wpPassword'));

Expand Down

0 comments on commit c948701

Please sign in to comment.