Skip to content

Commit

Permalink
Merge pull request #15010 from cypress-io/fix/run-ct-should-fail
Browse files Browse the repository at this point in the history
fix: add exit management on run-ct cli comand
  • Loading branch information
elevatebart committed Feb 10, 2021
2 parents 6c6a147 + 378292f commit a83ee64
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 29 deletions.
2 changes: 2 additions & 0 deletions cli/lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ module.exports = {
debug('running Cypress run-ct')
require('./exec/run')
.start(util.parseOpts(opts), { isComponentTesting: true })
.then(util.exit)
.catch(util.logErrorExit1)
})

program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="@percy/cypress" />
import React from 'react'
import { mount } from '@cypress/react'
import App from '../../src/app/app'
import App from '../../src/app/RunnerCt'
import State from '../../src/lib/state'
import '@packages/runner/src/main.scss'

Expand All @@ -12,7 +12,7 @@ class FakeEventManager {
notifyRunningSpec = () => { }
}

describe('App', () => {
describe('RunnerCt', () => {
function assertSpecsListIs (state: 'closed' | 'open') {
// for some reason should("not.be.visible") doesn't work here so ensure that specs list was outside of screen
cy.get('[data-cy=specs-list]').then(([el]) => {
Expand Down Expand Up @@ -42,30 +42,40 @@ describe('App', () => {
cy.percySnapshot()
})

it('toggles specs list drawer using shortcut', () => {
cy.viewport(1000, 500)
const state = new State({
reporterWidth: 500,
spec: null,
specs: [{ relative: '/test.js', absolute: 'root/test.js', name: 'test.js' }],
context('keyboard shortcuts', () => {
beforeEach(() => {
cy.viewport(1000, 500)
const state = new State({
reporterWidth: 500,
spec: null,
specs: [{ relative: '/test.js', absolute: 'root/test.js', name: 'test.js' }],
})

mount(
<App
state={state}
// @ts-ignore - this is difficult to stub. Real one breaks things.
eventManager={new FakeEventManager()}
config={{ projectName: 'Project', env: {} }}
/>,
)

cy.window().then((win) => win.focus())
})

mount(
<App
state={state}
// @ts-ignore - this is difficult to stub. Real one breaks things.
eventManager={new FakeEventManager()}
config={{ projectName: 'Project', env: {} }}
/>,
)
it('toggles specs list drawer using shortcut', () => {
cy.realPress(['Meta', 'B'])
cy.wait(400) // can not wait for this animation automatically :(
assertSpecsListIs('closed')

cy.window().then((win) => win.focus())
cy.realPress(['Meta', 'B'])
cy.wait(400) // can not wait for this animation automatically :(
assertSpecsListIs('closed')
cy.realPress(['Meta', 'B'])
assertSpecsListIs('open')
})

cy.realPress(['Meta', 'B'])
assertSpecsListIs('open')
it('focuses the search field on "/"', () => {
cy.realPress('/')
cy.get('input[placeholder="Find spec..."]').should('be.focused')
})
})

context('specs-list resizing', () => {
Expand Down Expand Up @@ -97,7 +107,7 @@ describe('App', () => {

cy.get('[data-cy=resizer]').trigger('mouseup', 'center')

cy.get('[data-cy=specs-list-resize-box').should('have.css', 'width', '425px')
cy.get('[data-cy=specs-list-resize-box').should('have.css', 'width', '429px')
})

it('restore specs list width after closing and reopen', () => {
Expand All @@ -107,14 +117,14 @@ describe('App', () => {
})

cy.get('[data-cy=resizer]').trigger('mouseup', 'center')
cy.get('[data-cy=specs-list-resize-box').should('have.css', 'width', '475px')
cy.get('[data-cy=specs-list-resize-box').should('have.css', 'width', '479px')

cy.get('[aria-label="Open the menu"').click()
assertSpecsListIs('closed')

cy.get('[aria-label="Open the menu"').click()

cy.get('[data-cy=specs-list-resize-box').should('have.css', 'width', '475px')
cy.get('[data-cy=specs-list-resize-box').should('have.css', 'width', '479px')
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,7 @@ describe('SpecList', () => {
/>,
)

cy.window().then((win) => win.focus())

cy.realPress('/')
cy.get('input[placeholder="Find spec..."]').should('be.focused')
cy.get('input[placeholder="Find spec..."]').focus()

cy.realPress('ArrowDown')
cy.realPress('ArrowDown')
Expand Down

4 comments on commit a83ee64

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a83ee64 Feb 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.6.0/circle-develop-a83ee64edc54b90fa019dcb1338f839222a2a36b/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a83ee64 Feb 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.5.0/appveyor-develop-a83ee64edc54b90fa019dcb1338f839222a2a36b/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a83ee64 Feb 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.5.0/appveyor-develop-a83ee64edc54b90fa019dcb1338f839222a2a36b/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a83ee64 Feb 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.6.0/circle-develop-a83ee64edc54b90fa019dcb1338f839222a2a36b/cypress.tgz

Please sign in to comment.