Skip to content

Commit aad04ce

Browse files
committed
Add new step to feature spec on cypress
1 parent 30a2123 commit aad04ce

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

cypress/integration/common/web_steps.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ When(`I click on the Users link in the navbar`, () => {
2929
cy.wait('@getUsers')
3030
})
3131

32-
Then(`I should see 12 cards with basic user info`, () => {
32+
Then(`I should see {string} cards with basic user info`, (number) => {
3333
cy.get('h1')
3434
.should('contain', 'Volunteers Directory')
3535
.get('.user-card')
36-
.should('have.length', 12)
36+
.should('have.length', Number(number))
37+
})
38+
39+
When(`I enter {string} into search bar`, name => {
40+
cy.get('input')
41+
.type(name)
3742
})
3843

3944
When("I click on a user's name", () => {

cypress/integration/journey.feature

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ Feature: Journey test
77
Given I am at the "Home" page
88
Then I should see "Scrums"
99
When I click on the Users link in the navbar
10-
Then I should see 12 cards with basic user info
10+
Then I should see "12" cards with basic user info
11+
When I enter "Matt" into search bar
12+
Then I should see "3" cards with basic user info
1113
When I click on a user's name
1214
Then I should see the user's info
1315
When I click on the Projects link in the navbar

0 commit comments

Comments
 (0)