Skip to content

Commit

Permalink
added localstorage currentquery check
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayadav09 committed Dec 13, 2024
1 parent 07c8939 commit 9fabf52
Showing 1 changed file with 30 additions and 14 deletions.
44 changes: 30 additions & 14 deletions tests/cypress/integration/Home/migration.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,21 @@ describe(
timeout: customCommandTimeout,
} ).should( 'be.visible' );
cy.wait( 1000 );
cy.get( 'div.helpcenter-question-block' )
.children()
.last()
.invoke( 'text' )
.then( ( text ) => {
expect( text.toLowerCase() ).to.contain( 'nameserver' );
} );
cy.get( 'div.helpcenter-question-block' ).then( ( $el ) => {
if ( $el.length ) {
cy.wrap( $el ).children().last().invoke( 'text' ).then( ( text ) => {
expect( text.toLowerCase() ).to.contain( 'nameserver' );
});
} else {
cy.window().then( ( win ) => {
const localStorageValue = win.localStorage.getItem( 'nfdHelpCurrentQuery' );
const localStorageContainsNameserver = localStorageValue
? localStorageValue.toLowerCase().includes( 'nameserver' )
: false;
expect( localStorageContainsNameserver ).to.be.true;
});
}
});
} );

it( 'Verify when connect domain to site clicked', () => {
Expand All @@ -94,13 +102,21 @@ describe(
timeout: customCommandTimeout,
} ).should( 'be.visible' );
cy.wait( 1000 );
cy.get( 'div.helpcenter-question-block' )
.children()
.last()
.invoke( 'text' )
.then( ( text ) => {
expect( text.toLowerCase() ).to.contain( 'domain' );
} );
cy.get( 'div.helpcenter-question-block' ).then( ( $el ) => {
if ( $el.length ) {
cy.wrap( $el ).children().last().invoke( 'text' ).then( ( text ) => {
expect( text.toLowerCase() ).to.contain( 'domain' );
});
} else {
cy.window().then( ( win ) => {
const localStorageValue = win.localStorage.getItem( 'nfdHelpCurrentQuery' );
const localStorageContainsDomain = localStorageValue
? localStorageValue.toLowerCase().includes( 'domain' )
: false;
expect( localStorageContainsDomain ).to.be.true;
});
}
});
} );

it( 'Verify when continue with store setup clicked', () => {
Expand Down

0 comments on commit 9fabf52

Please sign in to comment.