mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-31 03:29:43 -06:00
test: add "cypress-in-cypress" tests for navigating in and out of spec runner (#19845)
Co-authored-by: Barthélémy Ledoux <bart@cypress.io>
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
describe('Cypress In Cypress', () => {
|
||||
it('test component', () => {
|
||||
import defaultMessages from '@packages/frontend-shared/src/locales/en-US.json'
|
||||
|
||||
describe('Cypress In Cypress', { viewportWidth: 1200 }, () => {
|
||||
beforeEach(() => {
|
||||
cy.scaffoldProject('cypress-in-cypress')
|
||||
cy.openProject('cypress-in-cypress')
|
||||
cy.startAppServer('component')
|
||||
cy.visitApp()
|
||||
})
|
||||
|
||||
it('test component', () => {
|
||||
cy.contains('TestComponent.spec').click()
|
||||
cy.location().should((location) => {
|
||||
expect(location.hash).to.contain('TestComponent.spec')
|
||||
@@ -11,4 +16,23 @@ describe('Cypress In Cypress', () => {
|
||||
|
||||
cy.get('[data-model-state="passed"]').should('contain', 'renders the test component')
|
||||
})
|
||||
|
||||
it('navigation between specs and other parts of the app works', () => {
|
||||
cy.contains('TestComponent.spec').click()
|
||||
cy.get('[data-model-state="passed"]').should('contain', 'renders the test component')
|
||||
|
||||
// go to Settings page and back to spec runner
|
||||
cy.contains('a', 'Settings').click()
|
||||
cy.contains(defaultMessages.settingsPage.device.title).should('be.visible')
|
||||
cy.contains('a', 'Specs').click()
|
||||
cy.contains('TestComponent.spec').click()
|
||||
cy.get('[data-model-state="passed"]').should('contain', 'renders the test component')
|
||||
|
||||
// go to Runs page and back to spec runner
|
||||
cy.contains('a', 'Runs').click()
|
||||
cy.contains(defaultMessages.runs.connect.title).should('be.visible')
|
||||
cy.contains('a', 'Specs').click()
|
||||
cy.contains('TestComponent.spec').click()
|
||||
cy.get('[data-model-state="passed"]').should('contain', 'renders the test component')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
describe('Cypress In Cypress', () => {
|
||||
it('test e2e', () => {
|
||||
import defaultMessages from '@packages/frontend-shared/src/locales/en-US.json'
|
||||
|
||||
describe('Cypress In Cypress', { viewportWidth: 1200 }, () => {
|
||||
beforeEach(() => {
|
||||
cy.scaffoldProject('cypress-in-cypress')
|
||||
cy.openProject('cypress-in-cypress')
|
||||
cy.startAppServer()
|
||||
cy.visitApp()
|
||||
})
|
||||
|
||||
it('test e2e', () => {
|
||||
cy.contains('dom-content.spec').click()
|
||||
cy.location().should((location) => {
|
||||
expect(location.hash).to.contain('dom-content.spec')
|
||||
@@ -11,4 +16,23 @@ describe('Cypress In Cypress', () => {
|
||||
|
||||
cy.get('[data-model-state="passed"]').should('contain', 'renders the test content')
|
||||
})
|
||||
|
||||
it('navigation between specs and other parts of the app works', () => {
|
||||
cy.contains('dom-content.spec').click()
|
||||
cy.get('[data-model-state="passed"]').should('contain', 'renders the test content')
|
||||
|
||||
// go to Settings page and back to spec runner
|
||||
cy.contains('a', 'Settings').click()
|
||||
cy.contains(defaultMessages.settingsPage.device.title).should('be.visible')
|
||||
cy.contains('a', 'Specs').click()
|
||||
cy.contains('dom-content.spec').click()
|
||||
cy.get('[data-model-state="passed"]').should('contain', 'renders the test content')
|
||||
|
||||
// go to Runs page and back to spec runner
|
||||
cy.contains('a', 'Runs').click()
|
||||
cy.contains(defaultMessages.runs.connect.title).should('be.visible')
|
||||
cy.contains('a', 'Specs').click()
|
||||
cy.contains('dom-content.spec').click()
|
||||
cy.get('[data-model-state="passed"]').should('contain', 'renders the test content')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user