Skip to content

Commit

Permalink
add binary test
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiller1990 committed Sep 2, 2022
1 parent 5ef6bc1 commit a5db874
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 76 deletions.
70 changes: 35 additions & 35 deletions system-tests/test-binary/ci_environments_spec.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import systemTests, { ItOptions } from '../lib/system-tests'
// import systemTests, { ItOptions } from '../lib/system-tests'

function smokeTestDockerImage (title: string, dockerImage: string, expectedExitCode: number, onRun?: ItOptions['onRun']) {
systemTests.it(title, {
withBinary: true,
browser: 'electron',
dockerImage,
spec: 'test1.js',
specDir: 'tests',
project: 'todos',
expectedExitCode,
onRun,
})
}
// function smokeTestDockerImage (title: string, dockerImage: string, expectedExitCode: number, onRun?: ItOptions['onRun']) {
// systemTests.it(title, {
// withBinary: true,
// browser: 'electron',
// dockerImage,
// spec: 'test1.js',
// specDir: 'tests',
// project: 'todos',
// expectedExitCode,
// onRun,
// })
// }

describe('e2e binary CI environments', () => {
smokeTestDockerImage(
'bare node image fails (lacks xvfb)',
'node:12', 1,
async (exec) => {
const { stdout } = await exec()
// describe('e2e binary CI environments', () => {
// smokeTestDockerImage(
// 'bare node image fails (lacks xvfb)',
// 'node:12', 1,
// async (exec) => {
// const { stdout } = await exec()

expect(stdout).to.include('Your system is missing the dependency: Xvfb')
},
)
// expect(stdout).to.include('Your system is missing the dependency: Xvfb')
// },
// )

smokeTestDockerImage(
'bare xvfb image fails',
'cypressinternal/xvfb:12.13.0', 1,
)
// smokeTestDockerImage(
// 'bare xvfb image fails',
// 'cypressinternal/xvfb:12.13.0', 1,
// )

smokeTestDockerImage(
'ubuntu 16 passes',
'cypress/base:ubuntu16-12.13.1', 0,
)
// smokeTestDockerImage(
// 'ubuntu 16 passes',
// 'cypress/base:ubuntu16-12.13.1', 0,
// )

smokeTestDockerImage(
'ubuntu 19 passes',
'cypress/base:ubuntu19-node12.14.1', 0,
)
})
// smokeTestDockerImage(
// 'ubuntu 19 passes',
// 'cypress/base:ubuntu19-node12.14.1', 0,
// )
// })
24 changes: 12 additions & 12 deletions system-tests/test-binary/module_api_spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import systemTests from '../lib/system-tests'
// import systemTests from '../lib/system-tests'

describe('module API', () => {
systemTests.it('can run module API Mocha spec', {
timeout: 240000,
dockerImage: 'cypress/base:12',
withBinary: true,
project: 'module-api',
browser: 'electron',
command: 'yarn',
args: ['test'],
})
})
// describe('module API', () => {
// systemTests.it('can run module API Mocha spec', {
// timeout: 240000,
// dockerImage: 'cypress/base:12',
// withBinary: true,
// project: 'module-api',
// browser: 'electron',
// command: 'yarn',
// args: ['test'],
// })
// })
70 changes: 41 additions & 29 deletions system-tests/test-binary/node_versions_spec.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,46 @@
import systemTests from '../lib/system-tests'

function smokeTestDockerImage (dockerImage: string) {
context('e2e', () => {
systemTests.it(`can run in ${dockerImage}`, {
withBinary: true,
browser: 'electron',
dockerImage,
spec: 'test1.js',
specDir: 'tests',
project: 'todos',
})
})
// function smokeTestDockerImage (dockerImage: string) {
// context('e2e', () => {
// systemTests.it(`can run in ${dockerImage}`, {
// withBinary: true,
// browser: 'electron',
// dockerImage,
// spec: 'test1.js',
// specDir: 'tests',
// project: 'todos',
// })
// })

context('component', () => {
systemTests.it(`can run in ${dockerImage}`, {
withBinary: true,
browser: 'electron',
dockerImage,
testingType: 'component',
project: 'simple-ct',
spec: 'src/simple_passing_component.cy.js',
})
})
}
// context('component', () => {
// systemTests.it(`can run in ${dockerImage}`, {
// withBinary: true,
// browser: 'electron',
// dockerImage,
// testingType: 'component',
// project: 'simple-ct',
// spec: 'src/simple_passing_component.cy.js',
// })
// })
// }

describe('binary node versions', () => {
[
'cypress/base:12',
'cypress/base:14',
'cypress/base:16.14.2',
'cypress/base:17.3.0',
].forEach(smokeTestDockerImage)
// describe('binary node versions', () => {
// [
// 'cypress/base:12',
// 'cypress/base:14',
// 'cypress/base:16.14.2',
// 'cypress/base:17.3.0',
// ].forEach(smokeTestDockerImage)
// })

describe('type: module', () => {
systemTests.it('can run in cypress/base:16.17.0', {
withBinary: true,
project: 'config-cjs-and-esm/config-with-ts-module',
dockerImage: 'cypress/base:16.17.0',
testingType: 'e2e',
spec: 'app.cy.js',
browser: 'electron',
expectedExitCode: 0,
})
})

0 comments on commit a5db874

Please sign in to comment.