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

Fix basic info tests #441

Merged
merged 1 commit into from
Jan 31, 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
Expand Up @@ -136,6 +136,7 @@ describe( 'Basic Info Page', function () {
if ( cy.get( socialTest3 , { timeout: customCommandTimeout} ).should( 'exist' ) ) {
cy.get( socialTest3 ).clear({ force: true });
cy.get( socialTest3 ).type( sampleID );
cy.wait(200);
cy.get( '#facebook' ).focus();
cy.get( socialTest3 )
.invoke( 'val' )
Expand Down Expand Up @@ -165,7 +166,9 @@ describe( 'Basic Info Page', function () {

socialTest2.focus();
socialTest.type( invalidURL );
cy.wait(200);
socialTest2.focus();
cy.wait(200);
if(GetPluginId()!='hostgator'){
cy.get( '.Tooltip-Wrapper', { timeout: 3000 } ).should( 'exist' );
cy.get( '.Tooltip-Tip', { timeout: 3000 } )
Expand All @@ -177,16 +180,18 @@ describe( 'Basic Info Page', function () {
'have.text',
ModalText2
);
cy.get( '.components-modal__header button' , { timeout: customCommandTimeout } ).click()
cy.get(
'.browser-content_social_icon[style="background-image: var(--facebook-icon);"]'
).should( 'have.css', 'opacity', '0.75' );
}
else{
cy.get( '.Tooltip-Wrapper', { timeout: 3000 } ).should( 'exist' );
cy.get( '.Tooltip-Tip', { timeout: 3000 } )
.should( 'be.visible' );
};

cy.get( '.components-modal__header button' , { timeout: customCommandTimeout } ).click();
cy.wait(200);
cy.get(
'.browser-content_social_icon[style="background-image: var(--facebook-icon);"]'
).should( 'have.css', 'opacity', '0.75' );
// The URL Checker runs on a debounce
// Shows the message to the User in case of Invalid URL

Expand All @@ -195,8 +200,10 @@ describe( 'Basic Info Page', function () {

socialTest.focus();
socialTest.clear();
cy.wait(200);
socialTest.type( validURL );
socialTest2.focus();
cy.wait(200);
cy.get( '.Tooltip-Wrapper', { timeout: 3000 } ).should(
'not.exist'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ describe( 'Basic Info Page', function () {
if ( cy.get( socialTest3 , { timeout: customCommandTimeout } ).should( 'exist' ) ) {
cy.get( socialTest3 ).clear( { force: true } );
cy.get( socialTest3 ).type( sampleID );
cy.wait(200);
cy.get( '#facebook' ).focus();
cy.get( socialTest3 )
.invoke( 'val' )
Expand Down Expand Up @@ -172,8 +173,9 @@ describe( 'Basic Info Page', function () {

socialTest2.focus();
socialTest.type( invalidURL );
cy.wait(200);
socialTest2.focus();

cy.wait(200);
// The URL Checker runs on a debounce
// Shows the message to the User in case of Invalid URL
cy.get( '.Tooltip-Wrapper', { timeout: 3000 } ).should( 'exist' );
Expand All @@ -195,14 +197,17 @@ describe( 'Basic Info Page', function () {
}

cy.get( '.components-modal__header button' , { timeout: customCommandTimeout } ).click()
cy.wait(200);
cy.get(
'.browser-content_social_icon[style="background-image: var(--facebook-icon);"]'
).should( 'have.css', 'opacity', '0.75' );

socialTest.focus();
socialTest.clear();
cy.wait(200);
socialTest.type( validURL );
socialTest2.focus();
cy.wait(200);
cy.get( '.Tooltip-Wrapper', { timeout: 3000 } ).should(
'not.exist'
);
Expand Down
11 changes: 11 additions & 0 deletions tests/cypress/integration/wp-module-support/socialMedia.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ export const SocialMediaTextValidations = ( URL, ToolTipText, ModalHeaderText )
const socialTest = '#facebook';
if ( cy.get(socialTest).should( 'exist' ) ) {
cy.get(socialTest).clear();
cy.wait(200);
cy.get(socialTest).type( URL );
cy.wait(200);
cy.get('#twitter').focus();
cy.wait(200);
if(GetPluginId()=='hostgator'){
cy.get( '.Tooltip-Tip' , { timeout: 3000 })
.should('be.visible');
Expand All @@ -20,17 +23,25 @@ export const SocialMediaTextValidations = ( URL, ToolTipText, ModalHeaderText )
cy.get( '.Tooltip-Tip' , { timeout: 3000 })
.should('be.visible')
.should('contain', ToolTipText);
cy.wait(200);
cy.get(NextButton).click();
cy.get( '.components-modal__content' ).should('be.visible');
cy.get( '.components-modal__header-heading' ).should('have.text', ModalHeaderText);
};
cy.get(':nth-child(2) > .components-button-group > .is-secondary').click();
cy.wait(200);
cy.get(NextButton).click();
cy.wait(200);
cy.get('.components-modal__header button', {timeout: 10000}).click()
cy.wait(200);
cy.get(NextButton).click();
cy.wait(200);
cy.get(':nth-child(2) > .components-button-group > .is-primary').click();
cy.wait(200);
cy.url().should('not.contain', 'wp-setup/step/basic-info');
cy.wait(200);
cy.go('back');
cy.get( '.nfd-onboarding-drawer__toggle-button', { timeout: 10000 } ).click();
cy.wait(200);
}
};
Loading