Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
some changes to commands and test
Browse files Browse the repository at this point in the history
  • Loading branch information
sang2925 committed Feb 28, 2023
1 parent 1ead404 commit fc584b6
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 18 deletions.
1 change: 0 additions & 1 deletion applications/redeye-e2e/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module.exports = defineConfig({
reporterOptions: {
configFile: './reporter-config.json',
},

e2e: {
setupNodeEvents(on, config) {
on('task', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Search and filter campaigns and verify beacon counts', () => {
cy.get('[cy-test=search]').click().type(cmd).type('{enter}');
cy.wait('@searchCommands');
cy.get('[cy-test=search-result-item]').should('have.length.gt', 0).and('contain', cmd);
cy.get('[cy-test=close-search]').click();
cy.closeSearch();
});

it('Verify campaign card beacon number matches actual campaign', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Search and filter campaigns and verify beacon counts', () => {
cy.get('[cy-test=search]').click().type(cmd).type('{enter}');
cy.wait('@searchCommands');
cy.get('[cy-test=search-result-item]').should('have.length.gt', 0).and('contain', cmd);
cy.get('[cy-test=close-search]').click();
cy.closeSearch();
});

it('Verify campaign card beacon number matches actual campaign', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// <reference types="cypress" />
/// <reference types="cypress" />
let first;

describe('Search campaign and open one of the results', () => {
const camp = 'searchcampaign';
Expand All @@ -23,22 +24,24 @@ describe('Search campaign and open one of the results', () => {
.get('@list')
.its('length')
.then((resultSearch1) => {
// cy.log(resultSearch1);
first = resultSearch1;
});

// Close search box
cy.get('[cy-test=close-search]').click();
// Close search box
cy.closeSearch();

// Re-open search box; verify same results are showing
cy.clickSearch();
cy.get('[cy-test=search]').invoke('attr', 'value').should('include', searchTerm1);
cy.get('@list').should('contain', searchTerm1);
cy
.get('@list')
.its('length')
.then((resultSearch2) => {
// cy.log(resultSearch2);
expect(resultSearch2).to.equal(resultSearch1);
});
// Re-open search box; verify same results are showing
cy.clickSearch();

cy.get('[cy-test=search]').invoke('attr', 'value').should('include', searchTerm1);

cy.get('@list').should('contain', searchTerm1);

cy
.get('@list')
.its('length')
.then((resultSearch2) => {
expect(resultSearch2).to.equal(first);
});
});

Expand All @@ -55,6 +58,7 @@ describe('Search campaign and open one of the results', () => {

// Filter on Commands only
cy.get('[cy-test=filter-search]').click();

cy.get('[cy-test=Commands]').click();

// Log text showing in the first result
Expand Down
6 changes: 6 additions & 0 deletions applications/redeye-e2e/src/support/command.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,5 +294,11 @@ declare namespace Cypress {
* cy.toggleDarkTheme()
*/
toggleDarkTheme();

/**Closes the search modal in explorer
* @example
* cy.toggleDarkTheme()
*/
closeSearch();
}
}
4 changes: 4 additions & 0 deletions applications/redeye-e2e/src/support/explore.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Cypress.Commands.add('clickSearch', () => {
cy.get('[cy-test=search-mode]').click();
});

Cypress.Commands.add('closeSearch', () => {
cy.get('[cy-test=close-search]').click();
});

//CLICK PRESENTATION MODE ON EXPLORER PANEL
Cypress.Commands.add('clickPresentationMode', () => {
cy.get('[cy-test=presentation-mode').click();
Expand Down

0 comments on commit fc584b6

Please sign in to comment.