mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-07 15:31:30 -05:00
chore: (cy.prompt) fix prompt driver tests during contributor workflows (#32667)
* chore: (cy.prompt) fix prompt driver tests during contributor workflows * chore: (cy.prompt) fix prompt driver tests during contributor workflows * Update packages/driver/cypress/e2e/commands/prompt/prompt.cy.ts * rework test
This commit is contained in:
@@ -6,6 +6,9 @@ export const baseConfig: Cypress.ConfigOptions = {
|
||||
projectId: 'ypt4pf',
|
||||
experimentalMemoryManagement: true,
|
||||
experimentalWebKitSupport: true,
|
||||
env: {
|
||||
CI: process.env.CI,
|
||||
},
|
||||
hosts: {
|
||||
'foobar.com': '127.0.0.1',
|
||||
'*.foobar.com': '127.0.0.1',
|
||||
|
||||
@@ -3,22 +3,31 @@ describe('src/cy/commands/prompt', () => {
|
||||
Cypress.testingType = 'e2e'
|
||||
})
|
||||
|
||||
it('executes the prompt command', () => {
|
||||
// TODO: (cy.prompt) We will look into supporting other browsers
|
||||
// as this is rolled out. We will add error messages for other browsers
|
||||
// and add tests if necessary
|
||||
if (Cypress.isBrowser('webkit') || Cypress.isBrowser('firefox')) {
|
||||
return
|
||||
// TODO: (cy.prompt) We will look into supporting other browsers
|
||||
// as this is rolled out. We will add error messages for other browsers
|
||||
// and add tests if necessary
|
||||
if (!Cypress.isBrowser('webkit') && !Cypress.isBrowser('firefox')) {
|
||||
const contributorPr = Cypress.env('CI') && !Cypress.env('RECORD_KEY') && Cypress.config('isTextTerminal')
|
||||
|
||||
if (contributorPr) {
|
||||
it('executes the prompt command - contributor PR', (done) => {
|
||||
cy.on('fail', (err) => {
|
||||
expect(err.message).to.include('Record key not provided')
|
||||
|
||||
done()
|
||||
})
|
||||
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/prompt.html')
|
||||
cy.prompt(['Click the "click me" button'])
|
||||
})
|
||||
} else {
|
||||
it('executes the prompt command - normal PR', () => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/prompt.html')
|
||||
cy.prompt(['Click the "click me" button'])
|
||||
cy.get('#log').should('contain', 'clicked')
|
||||
})
|
||||
}
|
||||
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/prompt.html')
|
||||
|
||||
// TODO: add more tests when cy.prompt is built out, but for now this just
|
||||
// verifies that the command executes without throwing an error
|
||||
cy.prompt(['Click the "click me" button'])
|
||||
|
||||
cy.get('#log').should('contain', 'clicked')
|
||||
})
|
||||
}
|
||||
|
||||
it('fails when testingType is component', (done) => {
|
||||
cy.on('fail', (err) => {
|
||||
|
||||
Reference in New Issue
Block a user