Skip to content

Commit

Permalink
fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidsector9 committed Sep 20, 2024
1 parent f0d7329 commit 11891b3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ describe( '[Language processing] Excerpt Generation Tests', () => {
cy.get( '#postexcerpt-hide' ).check( { force: true } );

// Verify button exists.
cy.get( '#classifai-openai__excerpt-generate-btn' ).should( 'exist' );
cy.get( '#classifai-excerpt-generation__excerpt-generate-btn' ).should( 'exist' );

// Click on button and verify data loads in.
cy.get( '#classifai-openai__excerpt-generate-btn' ).click();
cy.get( '#classifai-excerpt-generation__excerpt-generate-btn' ).click();
cy.get( '#excerpt' ).should( 'have.value', data );

cy.disableClassicEditor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ describe( '[Language processing] Excerpt Generation Tests', () => {
cy.get( '#postexcerpt-hide' ).check( { force: true } );

// Verify button exists.
cy.get( '#classifai-openai__excerpt-generate-btn' ).should( 'exist' );
cy.get( '#classifai-excerpt-generation__excerpt-generate-btn' ).should( 'exist' );

// Click on button and verify data loads in.
cy.get( '#classifai-openai__excerpt-generate-btn' ).click();
cy.get( '#classifai-excerpt-generation__excerpt-generate-btn' ).click();
cy.get( '#excerpt' ).should( 'have.value', data );

cy.disableClassicEditor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ describe( '[Language processing] Excerpt Generation Tests', () => {
cy.get( '#postexcerpt-hide' ).check( { force: true } );

// Verify button exists.
cy.get( '#classifai-openai__excerpt-generate-btn' ).should( 'exist' );
cy.get( '#classifai-excerpt-generation__excerpt-generate-btn' ).should( 'exist' );

// Click on button and verify data loads in.
cy.get( '#classifai-openai__excerpt-generate-btn' ).click();
cy.get( '#classifai-excerpt-generation__excerpt-generate-btn' ).click();
cy.get( '#excerpt' ).should( 'have.value', data );

cy.disableClassicEditor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ describe( '[Language processing] Title Generation Tests', () => {

cy.visit( '/wp-admin/post-new.php' );

cy.get( '#classifai-openai__title-generate-btn' ).click();
cy.get( '#classifai-openai__modal' ).should( 'be.visible' );
cy.get( '.classifai-openai__result-item' )
cy.get( '#classifai-title-generation__title-generate-btn' ).click();
cy.get( '#classifai-title-generation__modal' ).should( 'be.visible' );
cy.get( '.classifai-title-generation__result-item' )
.first()
.find( 'textarea' )
.should( 'have.value', data );

cy.get( '.classifai-openai__select-title' ).first().click();
cy.get( '#classifai-openai__modal' ).should( 'not.be.visible' );
cy.get( '.classifai-title-generation__select-title' ).first().click();
cy.get( '#classifai-title-generation__modal' ).should( 'not.be.visible' );
cy.get( '#title' ).should( 'have.value', data );

cy.disableClassicEditor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ describe( '[Language processing] Title Generation Tests', () => {

cy.visit( '/wp-admin/post-new.php' );

cy.get( '#classifai-openai__title-generate-btn' ).click();
cy.get( '#classifai-openai__modal' ).should( 'be.visible' );
cy.get( '.classifai-openai__result-item' )
cy.get( '#classifai-title-generation__title-generate-btn' ).click();
cy.get( '#classifai-title-generation__modal' ).should( 'be.visible' );
cy.get( '.classifai-title-generation__result-item' )
.first()
.find( 'textarea' )
.should( 'have.value', data );

cy.get( '.classifai-openai__select-title' ).first().click();
cy.get( '#classifai-openai__modal' ).should( 'not.be.visible' );
cy.get( '.classifai-title-generation__select-title' ).first().click();
cy.get( '#classifai-title-generation__modal' ).should( 'not.be.visible' );
cy.get( '#title' ).should( 'have.value', data );

cy.disableClassicEditor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ describe( '[Language processing] Title Generation Tests', () => {

cy.visit( '/wp-admin/post-new.php' );

cy.get( '#classifai-openai__title-generate-btn' ).click();
cy.get( '#classifai-openai__modal' ).should( 'be.visible' );
cy.get( '.classifai-openai__result-item' )
cy.get( '#classifai-title-generation__title-generate-btn' ).click();
cy.get( '#classifai-title-generation__modal' ).should( 'be.visible' );
cy.get( '.classifai-title-generation__result-item' )
.first()
.find( 'textarea' )
.should( 'have.value', data );

cy.get( '.classifai-openai__select-title' ).first().click();
cy.get( '#classifai-openai__modal' ).should( 'not.be.visible' );
cy.get( '.classifai-title-generation__select-title' ).first().click();
cy.get( '#classifai-title-generation__modal' ).should( 'not.be.visible' );
cy.get( '#title' ).should( 'have.value', data );

cy.disableClassicEditor();
Expand Down

0 comments on commit 11891b3

Please sign in to comment.