File tree Expand file tree Collapse file tree 3 files changed +31
-4
lines changed
features/rope-record/rope-details
steps/rope-record/rope-details Expand file tree Collapse file tree 3 files changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ Feature: Rope Records
77 Scenario : User requests an extension for an In Service rope
88 Given I navigate to the Rope Detail Page for an In Service rope with Serial number 'CUCSNO168681'
99 And I provide the following information in the Request Extension form
10- | Request by days | 4 |
11- # Then I should be able to see the request in Extension history section
10+ | Request by days | 6 |
11+ Then I should be able to see the request in Extension history section
Original file line number Diff line number Diff line change 1+ import { Download , expect , Page } from '@playwright/test' ;
2+
3+ export class EmailVerification {
4+ private readonly page : Page ;
5+
6+ constructor ( page : Page ) {
7+ this . page = page ;
8+ }
9+
10+ verifyRequestExtensionEmailName ( download : Download ) : void {
11+ const filename = download . suggestedFilename ( ) ;
12+ expect ( filename ) . toMatch ( / ^ R e q u e s t e x t e n s i o n - .+ \. e m l $ / ) ;
13+ }
14+ }
Original file line number Diff line number Diff line change 1- import { DataTable , When } from '@cucumber/cucumber' ;
1+ import { DataTable , Then , When } from '@cucumber/cucumber' ;
2+ import { expect } from '@playwright/test' ;
23
34import { CreateRopeRecord } from '../../../pages/CreateRopeRecord' ;
5+ import { EmailVerification } from '../../../pages/EmailVerification' ;
46import { IHoistWorld } from '../../../support/hoist-world' ;
57
68When (
1820 const download1Promise = page . waitForEvent ( 'download' ) ;
1921 await page . getByRole ( 'button' , { name : 'Confirm' } ) . click ( ) ;
2022 const download1 = await download1Promise ;
21- console . log ( 'downloading email' , download1 ) ;
23+ const emailPage = new EmailVerification ( this . page ! ) ;
24+ emailPage . verifyRequestExtensionEmailName ( download1 ) ;
25+ } ,
26+ ) ;
27+
28+ Then (
29+ 'I should be able to see the request in Extension history section' ,
30+ async function ( this : IHoistWorld ) {
31+ await this . page ?. getByRole ( 'tab' , { name : 'Rope information' } ) . click ( ) ;
32+ const page = this . page ! ;
33+ const expectedValue = '6' ;
34+ await expect ( page . getByText ( `Requested: ${ expectedValue } days` ) . first ( ) ) . toBeVisible ( ) ;
2235 } ,
2336) ;
You can’t perform that action at this time.
0 commit comments