File tree Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 1+ @workwear
2+ Feature : Shop for Workwear
3+ I can search for and buy workwear
4+
5+ Scenario : View product detail
6+ Given I am on the Mammoth Workwear home page
7+ When I click navigation item "Safety Boots"
8+ And I click product item "Timberland Pro Euro Hiker 2G Safety Boots"
9+ Then I should see product detail with title "Timberland Pro Euro Hiker 2G Safety Boots"
Original file line number Diff line number Diff line change 1+ module . exports = {
2+
3+ url : 'http://mammothworkwear.com' ,
4+
5+ elements : {
6+ menuItem : 'nav[role="navigation"] ul li a' ,
7+ productItem : 'main .pitem a'
8+ } ,
9+
10+ clickNavigationItem : function ( containingText ) {
11+
12+ return helpers . clickHiddenElement ( page . mammothWorkwear . elements . menuItem , containingText ) ;
13+ } ,
14+
15+ clickProductItem : function ( containingText ) {
16+
17+ return helpers . clickHiddenElement ( page . mammothWorkwear . elements . productItem , containingText ) ;
18+ } ,
19+
20+ titleContains : function ( expectedTitle ) {
21+
22+ return driver . getTitle ( function ( pageTitle ) {
23+ expect ( pageTitle ) . to . contain ( expectedTitle ) ;
24+ } ) ;
25+ }
26+ } ;
Original file line number Diff line number Diff line change 1+ module . exports = function ( ) {
2+
3+ this . Given ( / ^ I a m o n t h e M a m m o t h W o r k w e a r h o m e p a g e $ / , function ( done ) {
4+
5+ // load google
6+ helpers . loadPage ( page . mammothWorkwear . url ) . then ( function ( ) {
7+ done ( ) ;
8+ } ) ;
9+ } ) ;
10+
11+ this . When ( / ^ I c l i c k n a v i g a t i o n i t e m " ( [ ^ " ] * ) " $ / , function ( linkTitle , done ) {
12+
13+ // click an item in the search results via the google page object
14+ page . mammothWorkwear . clickNavigationItem ( linkTitle ) . then ( function ( ) {
15+ done ( ) ;
16+ } ) ;
17+ } ) ;
18+
19+ this . Then ( / ^ I c l i c k p r o d u c t i t e m " ( [ ^ " ] * ) " $ / , function ( productTitle , done ) {
20+
21+ // click an item in the search results via the google page object
22+ page . mammothWorkwear . clickProductItem ( productTitle ) . then ( function ( ) {
23+ done ( ) ;
24+ } ) ;
25+ } ) ;
26+
27+ this . Then ( / ^ I s h o u l d s e e p r o d u c t d e t a i l w i t h t i t l e " ( [ ^ " ] * ) " $ / , function ( pageTitle , done ) {
28+
29+ page . mammothWorkwear . titleContains ( pageTitle ) . then ( function ( ) {
30+ done ( ) ;
31+ } ) ;
32+ } ) ;
33+ } ;
You can’t perform that action at this time.
0 commit comments