Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress Tests for AI SiteGen Preview Step #453

Merged
merged 3 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// <reference types="Cypress" />

import { AdminBarCheck, BackButtonCheck, DarkBGCheck, LightBGCheck, ProgressBarCheck } from "../wp-module-support/siteGen.cy";

describe( 'SiteGen Site Preview Step', function () {
before( () => {
cy.visit(
'wp-admin/index.php?page=nfd-onboarding#/sitegen/step/preview'
);
cy.wait(5000);
} );

it( 'Check for the header admin bar', () => {
AdminBarCheck();
} );

it( 'Check for the existing dark background', () => {
DarkBGCheck();
} );

it( 'Check for the light background', () => {
LightBGCheck();
} );

it( 'Check the Progress Bar Value', () => {
ProgressBarCheck('75%');
});

it( 'Check for back button and go back', () => {
BackButtonCheck('sitegen/step/preview');
cy.visit('wp-admin/index.php?page=nfd-onboarding#/sitegen/step/preview');
cy.reload();
} );

it( 'Check for by default 3 versions should be there', () => {
cy.get('.live-preview-sitegen--selectable-card', {timeout:20000})
.should('be.visible')
.should('have.length', 3);
} );

it( 'Check for the favourited theme versions', () => {
cy.get('g[clip-path="url(#heart-filled_svg__a)"]').should('not.exist'); // when no fav theme is selected
cy.get( '.live-preview-sitegen--selectable-card__live-preview-container-buttons__button__icon' )
.eq(0)
.scrollIntoView()
.should('be.visible')
.click();
cy.get('g[clip-path="url(#heart-filled_svg__a)"]' , {timeout:10000} )
.should('exist');
cy.get('.live-preview-sitegen--selectable-card__live-preview-container__overlay')
.eq(0)
.scrollIntoView()
.click();
cy.reload();
cy.wait(5000);
cy.get('g[clip-path="url(#heart-filled_svg__a)"]' , {timeout:10000} )
.should('exist');
cy.go('back');
cy.reload();
} );
sangeetha-nayak marked this conversation as resolved.
Show resolved Hide resolved

it( 'Check for regenerating the new theme versions', () => {
cy.get('[aria-label="Regenerate Content"]', {timeout:10000})
.eq(2)
.scrollIntoView()
.click();
cy.wait(3000);
cy.get('.live-preview-sitegen--selectable-card')
.should('be.visible')
.should('have.length', 4);
} );

it( 'Check for the preview note at the bottom', () => {
cy.get('.nfd-onboarding-step--site-gen__preview__note')
.scrollIntoView()
.should('be.visible');
cy.get('g[id="State\\=Active"]').should('exist');
cy.get('.nfd-onboarding-step--site-gen__preview__note span').scrollIntoView().contains('Favorite');
} );

it( 'Select any theme and go forward to the next step', () => {
cy.get('.live-preview-sitegen--selectable-card')
.eq(0)
.scrollIntoView()
.click();
cy.wait(5000);
cy.url().should('not.contain', 'sitegen/step/preview');
} );
});
sangeetha-nayak marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <reference types="Cypress" />

import { AdminBarCheck, BackButtonCheck, DarkBGCheck, LightBGCheck, ProgressBarCheck, SiteDescription} from "../wp-module-support/siteGen.cy";
import { AdminBarCheck, BackButtonCheck, DarkBGCheck, LightBGCheck, ProgressBarCheck} from "../wp-module-support/siteGen.cy";

describe( 'SiteGen Site Details Step', function () {
before( () => {
Expand Down
Loading