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:
Ryan Manuel
2025-10-08 08:55:11 -05:00
committed by GitHub
parent 33df568850
commit c3828e5206
2 changed files with 27 additions and 15 deletions
+3
View File
@@ -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) => {