Skip to content

Commit

Permalink
Add a step definition when I click link by the attribute name #141
Browse files Browse the repository at this point in the history
  • Loading branch information
TasneemNatshah committed Jul 10, 2024
1 parent 29cff3f commit eeb7070
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
16 changes: 16 additions & 0 deletions tests/features/test--when--i-click-link-by-attribute.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Feature: An example to click link by its attribute

As a tester
I want to be able to click link by its attribute

Scenario: Check click link by class attribute
Given I am on "/test--when--i-click-link.html"
When I click "aboutUs" by "class" attr
And I wait max of 2 seconds
Then I should see "About Us"

Scenario: Check click link by its id attribute
Given I am on "/test--when--i-click-link.html"
When I click "aboutUsid" by its "id" attribute
And I wait max of 2 seconds
Then I should see "About Us"
8 changes: 4 additions & 4 deletions tests/step-definitions/webship.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ When(/^(I|we)* click "([^"]*)?"$/, function (pronoundCase, item) {

/**
* Click Link with specified element
* Example: When I click "btn-pressid" by attr
* Example: When I click "btn-pressid" by attribute
* Example: And I click "Your full name" by "class" attribute
* Example: And I click "Your full name" by its "id" attribute
* Example: When I click "aboutUs" by attr
* Example: When I click "aboutUs" by attribute
* Example: And I click "aboutUs" by "class" attr
* Example: And I click "aboutUsid" by its "id" attribute
*
*/
When(/^(I|we)* click "([^"]*)?" by( its)*( "([^"]*)?")* (attribute|attr)$/, function (pronoundCase, attrValue, itsCase, attr, attrCase) {
Expand Down

0 comments on commit eeb7070

Please sign in to comment.