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

FS-52: Testing keyword search #71

Open
wants to merge 6 commits into
base: 3.x
Choose a base branch
from
Open
Changes from 3 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
26 changes: 26 additions & 0 deletions cypress/integration/keyword.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// <reference types="cypress" />

describe('Keyword search', () => {
const keyword = 'Terrier';
const resultCount = 4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@russom-woldezghi I retested this yesterday after destroying my vagrant and provisioning it again. I now get 2 results consistently on all sites including this one, so I think 2 might be correct. Can you verify with the current demo environment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get 5.

Screen Shot 2020-05-06 at 9 59 22 AM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My result matches this

const pagerCount = 1;

it(`Keyword search is ran using the word "${keyword}" to load "${resultCount}" search result items.`, () => {
cy.visit('/');

// Search for "terrier" and click search icon.
cy.get('#search').type(' ' + keyword);
cy.get('.fs-search-form__submit').click();

// Verify word search is returing terrier related results and confirming count.
cy.get('.fs-applied-filters__filter').contains(keyword);
cy.get('#stat').contains('Showing ' + resultCount + ' results');
cy.get('.fs-search-results__heading')
.should('have.length', resultCount);

// Verify pager page link/count.
cy.get('.fs-search-pager__item.is-active .fs-search-pager__item-button')
.contains(pagerCount)
.should('be.visible');
});
});