Skip to content

Commit

Permalink
Cypress testing: More waits
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuess committed Jun 19, 2024
1 parent a7add6c commit e8272cc
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions acceptance/cypress/tests/search.monolingual.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,58 +86,73 @@ describe('Searchkit block tests – search', () => {
});

it('I see all if no filter selected', function () {
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').contains('Der Garten im Februar');
});

it('I can search fuzzy', function () {
cy.get('.searchbar-wrapper input').type('februax{enter}');
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').contains('Der Garten im Februar');
cy.get('.block.searchkitsearch').should('not.contain', 'März');
});

it('I can search with inflection', function () {
cy.get('.searchbar-wrapper input').clear().type('Männer{enter}');
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').contains('Testseite Mann');

cy.get('.searchbar-wrapper input').clear().type('Mann{enter}');
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').contains('Testseite Männer');
});

it('I can search with decompounding', function () {
cy.get('.searchbar-wrapper input').type('Garten{enter}');
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').contains('Garten-Blog');

cy.get('.searchbar-wrapper input').clear().type('Garten-Blog{enter}');
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').contains('Februar');
});

it('I can search with wildcard', function () {
cy.get('.searchbar-wrapper input').type('Feb*{enter}');
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').contains('Der Garten im Februar');
});

it('I can search for an exact match', function () {
cy.get('.searchbar-wrapper input').type('"Mann"{enter}');
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').contains('Testseite Mann');

cy.get('.searchbar-wrapper input').clear().type('"Mann"{enter}');
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').should('not.contain', 'Männer');
});

it('I can search for a compounded word', function () {
cy.get('.searchbar-wrapper input').type('stelle{enter}');
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').contains('Testseite Lehrstellenbörsen');

cy.get('.searchbar-wrapper input').clear().type('Lehre{enter}');
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').contains('Testseite Lehrstellenbörsen');

cy.get('.searchbar-wrapper input').clear().type('Börse{enter}');
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').contains('Testseite Lehrstellenbörsen');

cy.get('.searchbar-wrapper input').clear().type('Lehrstellenbörse{enter}');
cy.wait('@kitsearch');
cy.get('.block.searchkitsearch').contains('Testseite Stelle');
});

// Blocks text
it('I can search in blocks', function () {
cy.intercept('POST', '/**/@kitsearch').as('kitsearch');
cy.intercept('GET', `/**/*?expand*`).as('content');
cy.visit('/garten-blog/februar');
cy.get('a.edit').click();

Expand Down

0 comments on commit e8272cc

Please sign in to comment.