Explorar o código

update cypress test

ryoji-s %!s(int64=2) %!d(string=hai) anos
pai
achega
74523e07c1

+ 9 - 9
apps/app/test/cypress/e2e/30-search/30-search--search.cy.ts

@@ -123,7 +123,7 @@ context('Search all pages', () => {
     cy.waitUntil(() => {
     cy.waitUntil(() => {
       // do
       // do
       cy.getByTestid('grw-tag-labels').as('tagLabels').should('be.visible');
       cy.getByTestid('grw-tag-labels').as('tagLabels').should('be.visible');
-      cy.get('@tagLabels').find('a.btn').as('btn').click();
+      cy.get('@tagLabels').find('a.grw-tag').as('btn').click();
       // wait until
       // wait until
       return cy.get('body').within(() => {
       return cy.get('body').within(() => {
         return Cypress.$('.modal.show').is(':visible');
         return Cypress.$('.modal.show').is(':visible');
@@ -180,7 +180,7 @@ context('Search all pages', () => {
     cy.waitUntil(() => {
     cy.waitUntil(() => {
       // do
       // do
       cy.getByTestid('grw-tag-labels').as('tagLabels').should('be.visible');
       cy.getByTestid('grw-tag-labels').as('tagLabels').should('be.visible');
-      cy.get('@tagLabels').find('a').contains(tag).as('tag').click();
+      cy.get('@tagLabels').find('a.grw-tag').contains(tag).as('tag').click();
       // wait until
       // wait until
       return cy.getByTestid('search-result-base').then($elem => $elem.is(':visible'));
       return cy.getByTestid('search-result-base').then($elem => $elem.is(':visible'));
     });
     });
@@ -225,23 +225,23 @@ context('Sort with dropdown', () => {
     // open sort dropdown
     // open sort dropdown
     cy.waitUntil(() => {
     cy.waitUntil(() => {
       // do
       // do
-      cy.get('.grw-search-page-nav').within(() => {
-        cy.get('button.dropdown-toggle').first().click({force: true});
+      cy.get('.search-control').within(() => {
+        cy.get('button').first().click({force: true});
       });
       });
       // wait until
       // wait until
-      return cy.get('.grw-search-page-nav').within(() => {
+      return cy.get('.search-control').within(() => {
         return Cypress.$('.dropdown-menu.show').is(':visible');
         return Cypress.$('.dropdown-menu.show').is(':visible');
       });
       });
     });
     });
   });
   });
 
 
   it('Open sort dropdown', () => {
   it('Open sort dropdown', () => {
-    cy.get('.grw-search-page-nav .dropdown-menu.show').should('be.visible');
+    cy.get('.search-control .dropdown-menu.show').should('be.visible');
       cy.screenshot(`${ssPrefix}2-open-sort-dropdown`);
       cy.screenshot(`${ssPrefix}2-open-sort-dropdown`);
   });
   });
 
 
   it('Sort by relevance', () => {
   it('Sort by relevance', () => {
-    cy.get('.grw-search-page-nav .dropdown-menu.show').should('be.visible').within(() => {
+    cy.get('.search-control .dropdown-menu.show').should('be.visible').within(() => {
       cy.get('button:nth-child(1)').click({force: true});
       cy.get('button:nth-child(1)').click({force: true});
     });
     });
     cy.getByTestid('search-result-base').should('be.visible');
     cy.getByTestid('search-result-base').should('be.visible');
@@ -256,7 +256,7 @@ context('Sort with dropdown', () => {
   });
   });
 
 
   it('Sort by creation date', () => {
   it('Sort by creation date', () => {
-    cy.get('.grw-search-page-nav .dropdown-menu.show').should('be.visible').within(() => {
+    cy.get('.search-control .dropdown-menu.show').should('be.visible').within(() => {
       cy.get('button:nth-child(2)').click({force: true});
       cy.get('button:nth-child(2)').click({force: true});
     });
     });
     cy.getByTestid('search-result-base').should('be.visible');
     cy.getByTestid('search-result-base').should('be.visible');
@@ -271,7 +271,7 @@ context('Sort with dropdown', () => {
   });
   });
 
 
   it('Sort by last update date', () => {
   it('Sort by last update date', () => {
-    cy.get('.grw-search-page-nav .dropdown-menu.show').should('be.visible').within(() => {
+    cy.get('.search-control .dropdown-menu.show').should('be.visible').within(() => {
       cy.get('button:nth-child(3)').click({force: true});
       cy.get('button:nth-child(3)').click({force: true});
     });
     });
     cy.getByTestid('search-result-base').should('be.visible');
     cy.getByTestid('search-result-base').should('be.visible');