-
Notifications
You must be signed in to change notification settings - Fork 10
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
[test] filters e2e #182
Open
Faria-Ejaz
wants to merge
7
commits into
master
Choose a base branch
from
filters-test
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[test] filters e2e #182
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3814619
[test] filtersOrganisation
Faria-Ejaz f055909
[test] Oraganisation filter
Faria-Ejaz 7a6790c
[feat] more filters test cases added
Faria-Ejaz 413b753
[WIP][test] Filters Testing
Faria-Ejaz 96f1d4c
[WIP] Resolved issues
Faria-Ejaz 1b3b029
Resolved Issues
Faria-Ejaz 325f5a2
fixed bugs
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
client/cypress/integration/event-manager/Filters/date_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* global describe */ | ||
/* global context */ | ||
/* global it */ | ||
/* global expect */ | ||
/* global cy */ | ||
/* eslint no-undef: "error" */ | ||
|
||
const URL = 'http://localhost:3000/events/'; | ||
|
||
describe('Date Filter Testing', () => { | ||
context('Test for Filters Route', () => { | ||
it('Should be on Filters page', () => { | ||
cy.visit('/events'); | ||
cy.get('h3').should('contain', 'Welcome to Event Management'); | ||
}); | ||
}); | ||
|
||
context('Test for Date Filter', () => { | ||
it('should only accept a correct date format', () => { | ||
cy.get("input[name='filterDateTo']") | ||
.type('2018-10-03') | ||
.should('have.value', '2018-10-03'); //Event END Date | ||
cy.get("input[name='filterDateFrom']") | ||
.type('2011-10-06') | ||
.should('have.value', '2011-10-06'); //Event START date | ||
cy.visit(URL); | ||
}); | ||
|
||
//BUGS-NOT WORKING | ||
// it('should display 1 result on Start date filter ', () => { | ||
// cy.get("input[name='filterDateFrom']") | ||
// .type('2018-10-03') | ||
// .should('have.value', '2018-10-03'); //Start Event Date | ||
|
||
// cy.get('.btn').click(); | ||
// cy.get('#event-list a') | ||
// .should('have.attr', 'href') | ||
// .and('include', '/events/2') | ||
// .then(href => { | ||
// cy.visit(href); | ||
// cy.get( | ||
// ':nth-child(3) > :nth-child(1) > .row > .col-md-10 > .text-dark' | ||
// ).should('contain', 'Saturday, October 6, 2018 11:00 AM'); | ||
// }); | ||
// cy.visit('http://localhost:3000/events/'); | ||
// }); | ||
|
||
// it('should display 3 results on end date filter ', () => { | ||
// cy.get("input[name='filterDateTo']") | ||
// .type('2011-10-06') | ||
// .should('have.value', '2011-10-06'); //End Event date | ||
|
||
// cy.get('.btn').click(); | ||
// cy.get('#event-list a') | ||
// .should('have.attr', 'href') | ||
// .and('include', '/events/2') | ||
// .then(href => { | ||
// cy.visit(href); | ||
// cy.get( | ||
// ':nth-child(1) > .card > .card-body > .card-subtitle > .text-muted' | ||
// ).should('contain', 'Saturday, October 6, 2018 11:00 AM'); | ||
// cy.get( | ||
// ':nth-child(2) > .card > .card-body > .card-subtitle > .text-muted' | ||
// ).should('contain', 'Wednesday, October 3, 2018 11:00 AM'); | ||
// cy.get( | ||
// ':nth-child(3) > .card > .card-body > .card-subtitle > .text-muted' | ||
// ).should('contain', 'Tuesday, October 2, 2018 11:00 AM'); | ||
// }); | ||
// }); | ||
|
||
}); | ||
|
||
|
||
}); |
39 changes: 39 additions & 0 deletions
39
client/cypress/integration/event-manager/Filters/keywords_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* global describe */ | ||
/* global context */ | ||
/* global it */ | ||
/* global expect */ | ||
/* global cy */ | ||
/* eslint no-undef: "error" */ | ||
|
||
const kw = ':nth-child(8) > .form-control'; | ||
const URL = 'http://localhost:3000/events/'; | ||
|
||
describe('KeyWords Filter Testing', () => { | ||
context('Test for Filters Route', () => { | ||
it('Should be on Filters page', () => { | ||
cy.visit('/events'); | ||
cy.get('h3').should('contain', 'Welcome to Event Management'); | ||
}); | ||
}); | ||
context('Test for Key Words filter', () => { | ||
it('should display 1 result', () => { | ||
cy.get(kw).type('const'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make a data set for these values |
||
cy.get(kw).should('have.value', 'const'); | ||
cy.get('.btn').click(); | ||
cy.get('.card-text').should('contain', 'const'); | ||
cy.visit(URL); | ||
}); | ||
it('should display 2 result', () => { | ||
cy.get(kw).type('sasta'); | ||
cy.get(kw).should('have.value', 'sasta'); | ||
cy.get('.btn').click(); | ||
cy.get('.card div') | ||
.should('have.length', '2') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add some generic tests. We are testing components which could have more than 2 results |
||
.each($div => { | ||
cy.wrap($div) | ||
.get('.card > .card-body > .card-text') | ||
.should('contain', 'sasta'); | ||
}); | ||
}); | ||
}); | ||
}); |
54 changes: 54 additions & 0 deletions
54
client/cypress/integration/event-manager/Filters/location_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* global describe */ | ||
/* global context */ | ||
/* global it */ | ||
/* global expect */ | ||
/* global cy */ | ||
/* eslint no-undef: "error" */ | ||
|
||
const loc = | ||
':nth-child(4) .Select .Select-control .Select-arrow-zone .Select-arrow'; | ||
const delay = 30000; | ||
const URL = 'http://localhost:3000/events/'; | ||
|
||
describe('Location Filter Testing', () => { | ||
context('Test for Filters Route', () => { | ||
it('Should be on Filters page', () => { | ||
cy.visit('/events'); | ||
cy.get('h3').should('contain', 'Welcome to Event Management'); | ||
}); | ||
}); | ||
|
||
context('Test for location filter ', () => { | ||
it('should only have single item', () => { | ||
cy.get(loc, { timeout: delay }) | ||
.eq(0) | ||
.click(); | ||
cy.get('div.Select-menu-outer').should('be.visible'); | ||
cy.contains('NIC').click(); | ||
cy.get('.Select-value #react-select-3--value-item').should( | ||
'contain', | ||
'NIC' | ||
); | ||
cy.get(loc, { timeout: delay }) | ||
.eq(0) | ||
.click(); | ||
cy.contains('neduet').click(); | ||
cy.get('.Select-value #react-select-3--value-item').should( | ||
'contain', | ||
'neduet' | ||
); | ||
cy.get('.btn').click(); | ||
cy.get('#event-list a') | ||
.should('have.attr', 'href') | ||
.and('include', '/events/2') | ||
.then(href => { | ||
cy.visit(href); | ||
cy.get(':nth-child(3) > .row > .col-md-10 > .text-dark').should( | ||
'contain', | ||
'neduet johar' | ||
); | ||
}); | ||
cy.visit(URL); | ||
}); | ||
}); | ||
}); |
94 changes: 94 additions & 0 deletions
94
client/cypress/integration/event-manager/Filters/organisation_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* global describe */ | ||
/* global context */ | ||
/* global it */ | ||
/* global expect */ | ||
/* global cy */ | ||
/* eslint no-undef: "error" */ | ||
|
||
const delay = 30000; | ||
const org = | ||
':nth-child(1) .Select .Select-control .Select-arrow-zone .Select-arrow'; | ||
const URL = 'http://localhost:3000/events/'; | ||
|
||
|
||
describe('Organisation Filter Testing', () => { | ||
context('Test for Filters Route', () => { | ||
it('Should be on Filters page', () => { | ||
cy.visit('/events'); | ||
cy.get('h3').should('contain', 'Welcome to Event Management'); | ||
}); | ||
}); | ||
|
||
context('Test for Organization Filter', () => { | ||
it('should have a clickable arrow button', () => { | ||
cy.get(org, { timeout: delay }) | ||
.eq(0) | ||
.click(); //Clicks the toggle button | ||
cy.get('div.Select-menu-outer').should('be.visible'); | ||
}); | ||
|
||
it('should display 1 result on single item selection', () => { | ||
cy.get(org, { timeout: delay }).eq(0); | ||
cy.contains('NES').click(); | ||
cy.get('.Select-value #react-select-2--value-0').should('contain', 'NES'); | ||
cy.get('.btn').click(); | ||
cy.get('#event-list a') | ||
.should('have.attr', 'href') | ||
.and('include', '/events/2') | ||
.then(href => { | ||
cy.visit(href); | ||
cy.get( | ||
':nth-child(3) > :nth-child(4) > .row > .col-md-10 > a > .text-dark' | ||
).should('contain', 'NES'); | ||
}); | ||
cy.visit(URL); | ||
}); | ||
|
||
it('should display 2 results on 2 items selection', () => { | ||
cy.get(org, { timeout: delay }) | ||
.eq(0) | ||
.click(); | ||
cy.contains('NES').click(); | ||
cy.get('.Select-value #react-select-2--value-0').should('contain', 'NES'); | ||
|
||
cy.get(org, { timeout: delay }) | ||
.eq(0) | ||
.click(); | ||
cy.contains('Recurship').click(); | ||
cy.get('.Select-value #react-select-2--value-1').should( | ||
'contain', | ||
'Recurship' | ||
); | ||
cy.get('.btn').click(); | ||
cy.get('#event-list a') | ||
.eq(0) | ||
.should('have.attr', 'href') | ||
.and('include', '/events/1'); | ||
|
||
cy.get('#event-list a') | ||
.eq(1) | ||
.should('have.attr', 'href') | ||
.and('include', '/events/2'); | ||
}); | ||
|
||
it('should cancel all the items at once', () => { | ||
cy.get(org, { timeout: delay }) | ||
.eq(0) | ||
.click(); | ||
cy.contains('NES').click(); | ||
cy.get('.Select-value #react-select-2--value-0').should('contain', 'NES'); | ||
|
||
cy.get(org, { timeout: delay }) | ||
.eq(0) | ||
.click(); | ||
cy.contains('Recurship').click(); | ||
cy.get('.Select-value #react-select-2--value-1').should( | ||
'contain', | ||
'Recurship' | ||
); | ||
cy.get( | ||
':nth-child(1)> .Select > .Select-control > .Select-clear-zone > .Select-clear' | ||
).click(); | ||
}); | ||
}); | ||
}); |
Empty file.
63 changes: 63 additions & 0 deletions
63
client/cypress/integration/event-manager/Filters/sponsors_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* global describe */ | ||
/* global context */ | ||
/* global it */ | ||
/* global expect */ | ||
/* global cy */ | ||
/* eslint no-undef: "error" */ | ||
|
||
const spons = | ||
':nth-child(5) .Select .Select-control .Select-arrow-zone .Select-arrow'; | ||
const delay = 30000; | ||
|
||
describe('Sponsors Filter Testing', () => { | ||
context('Test for Filters Route', () => { | ||
it('Should be on Filters page', () => { | ||
cy.visit('/events'); | ||
cy.get('h3').should('contain', 'Welcome to Event Management'); | ||
}); | ||
}); | ||
|
||
context('Test for sponsors filter', () => { | ||
it('should have one item', () => { | ||
cy.get(spons, { timeout: delay }) | ||
.eq(0) | ||
.click(); | ||
cy.get('div.Select-menu-outer').should('be.visible'); | ||
cy.contains('tapal').click(); | ||
cy.get('.Select-value #react-select-4--value-0').should( | ||
'contain', | ||
'tapal' | ||
); | ||
}); | ||
|
||
it('should deselect item', () => { | ||
cy.get('.Select-value-icon').click(); | ||
}); | ||
|
||
it('should have multiple items', () => { | ||
cy.get(spons, { timeout: delay }) | ||
.eq(0) | ||
.click(); | ||
cy.contains('nokia').click(); | ||
cy.get('.Select-value #react-select-4--value-0').should( | ||
'contain', | ||
'nokia' | ||
); | ||
|
||
cy.get(spons, { timeout: delay }) | ||
.eq(0) | ||
.click(); | ||
cy.contains('apple').click(); | ||
cy.get('.Select-value #react-select-4--value-1').should( | ||
'contain', | ||
'apple' | ||
); | ||
}); | ||
|
||
it('should cancel all the items at once', () => { | ||
cy.get( | ||
':nth-child(5) > .Select > .Select-control > .Select-clear-zone > .Select-clear' | ||
).click(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This heading will be removed in future, can you please assert something else