From a5db87411bf52c658c64b51d28c04495b4676d83 Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Fri, 2 Sep 2022 11:07:04 +1000 Subject: [PATCH] add binary test --- .../test-binary/ci_environments_spec.ts | 70 +++++++++---------- system-tests/test-binary/module_api_spec.ts | 24 +++---- .../test-binary/node_versions_spec.ts | 70 +++++++++++-------- 3 files changed, 88 insertions(+), 76 deletions(-) diff --git a/system-tests/test-binary/ci_environments_spec.ts b/system-tests/test-binary/ci_environments_spec.ts index 39d15c1d3fbb..a80e43d1f0d0 100644 --- a/system-tests/test-binary/ci_environments_spec.ts +++ b/system-tests/test-binary/ci_environments_spec.ts @@ -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, +// ) +// }) diff --git a/system-tests/test-binary/module_api_spec.ts b/system-tests/test-binary/module_api_spec.ts index 9b2cfc3f40f7..36005e2f0668 100644 --- a/system-tests/test-binary/module_api_spec.ts +++ b/system-tests/test-binary/module_api_spec.ts @@ -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'], +// }) +// }) diff --git a/system-tests/test-binary/node_versions_spec.ts b/system-tests/test-binary/node_versions_spec.ts index d006b4b2730e..033dc5082aa2 100644 --- a/system-tests/test-binary/node_versions_spec.ts +++ b/system-tests/test-binary/node_versions_spec.ts @@ -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, + }) })