@@ -3,22 +3,31 @@ describe('src/cy/commands/prompt', () => {
3
3
Cypress . testingType = 'e2e'
4
4
} )
5
5
6
- it ( 'executes the prompt command' , ( ) => {
7
- // TODO: (cy.prompt) We will look into supporting other browsers
8
- // as this is rolled out. We will add error messages for other browsers
9
- // and add tests if necessary
10
- if ( Cypress . isBrowser ( 'webkit' ) || Cypress . isBrowser ( 'firefox' ) ) {
11
- return
6
+ // TODO: (cy.prompt) We will look into supporting other browsers
7
+ // as this is rolled out. We will add error messages for other browsers
8
+ // and add tests if necessary
9
+ if ( ! Cypress . isBrowser ( 'webkit' ) && ! Cypress . isBrowser ( 'firefox' ) ) {
10
+ const contributorPr = Cypress . env ( 'CI' ) && ! Cypress . env ( 'RECORD_KEY' ) && Cypress . config ( 'isTextTerminal' )
11
+
12
+ if ( contributorPr ) {
13
+ it ( 'executes the prompt command - contributor PR' , ( done ) => {
14
+ cy . on ( 'fail' , ( err ) => {
15
+ expect ( err . message ) . to . include ( 'Record key not provided' )
16
+
17
+ done ( )
18
+ } )
19
+
20
+ cy . visit ( 'http://www.foobar.com:3500/fixtures/prompt.html' )
21
+ cy . prompt ( [ 'Click the "click me" button' ] )
22
+ } )
23
+ } else {
24
+ it ( 'executes the prompt command - normal PR' , ( ) => {
25
+ cy . visit ( 'http://www.foobar.com:3500/fixtures/prompt.html' )
26
+ cy . prompt ( [ 'Click the "click me" button' ] )
27
+ cy . get ( '#log' ) . should ( 'contain' , 'clicked' )
28
+ } )
12
29
}
13
-
14
- cy . visit ( 'http://www.foobar.com:3500/fixtures/prompt.html' )
15
-
16
- // TODO: add more tests when cy.prompt is built out, but for now this just
17
- // verifies that the command executes without throwing an error
18
- cy . prompt ( [ 'Click the "click me" button' ] )
19
-
20
- cy . get ( '#log' ) . should ( 'contain' , 'clicked' )
21
- } )
30
+ }
22
31
23
32
it ( 'fails when testingType is component' , ( done ) => {
24
33
cy . on ( 'fail' , ( err ) => {
0 commit comments