mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-07 23:19:48 -06:00
chore: update packages/example deployment script and cleanup package/example (#25091)
Co-authored-by: Bill Glesias <bglesias@gmail.com>
This commit is contained in:
@@ -13,9 +13,13 @@ program
|
||||
await fs.remove(destinationPath)
|
||||
await fs.copy(exampleFolder, destinationPath, { recursive: true })
|
||||
|
||||
console.log(`✅ Example was successfully created at ${chalk.cyan(destination)}`)
|
||||
console.log(`✅ E2E Examples were successfully created at ${chalk.cyan(destination)}`)
|
||||
|
||||
await fs.copy(path.join(__dirname, 'example-tsconfig.json'), path.join(destination, 'tsconfig.json'))
|
||||
await fs.copy(path.join(__dirname, 'examples', 'cypress'), path.join(destination))
|
||||
|
||||
console.log(`✅ Cypress Setup was successfully created at ${chalk.cyan(destination)}`)
|
||||
|
||||
await fs.copy(path.join(__dirname, 'examples', 'tsconfig.json'), path.join(destination, 'tsconfig.json'))
|
||||
|
||||
console.log(`✅ tsconfig.json was created for ${chalk.cyan(destination)}`)
|
||||
})
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// ***********************************************************
|
||||
// This example support/component.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands'
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
@@ -0,0 +1,20 @@
|
||||
// ***********************************************************
|
||||
// This example support/e2e.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands'
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
@@ -81,11 +81,13 @@ describe('App: Specs', () => {
|
||||
'cypress_api',
|
||||
'files',
|
||||
'location',
|
||||
'misc',
|
||||
'navigation',
|
||||
'network_requests',
|
||||
'querying',
|
||||
'spies_stubs_clocks',
|
||||
'storage',
|
||||
'traversal',
|
||||
'utilities',
|
||||
'viewport',
|
||||
'waiting',
|
||||
@@ -114,10 +116,7 @@ describe('App: Specs', () => {
|
||||
additionalIgnorePattern: [],
|
||||
})).map((spec) => spec.relative)
|
||||
|
||||
// Validate that all expected paths have been generated within the data context
|
||||
expect(generatedSpecPaths.filter((path) => {
|
||||
return options.expectedScaffoldPathsForPlatform.includes(path)
|
||||
})).to.have.lengthOf(options.expectedScaffoldPathsForPlatform.length)
|
||||
expect(generatedSpecPaths).to.include.members(options.expectedScaffoldPathsForPlatform)
|
||||
}, { expectedScaffoldPathsForPlatform })
|
||||
|
||||
// cy.percySnapshot() // TODO: restore when Percy CSS is fixed. See https://github.com/cypress-io/cypress/issues/23435
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { gql, useMutation } from '@urql/vue'
|
||||
import { ScaffoldGeneratorStepOne_ScaffoldIntegrationDocument } from '../../../generated/graphql'
|
||||
import { ScaffoldGeneratorStepOne_E2eExamplesDocument } from '../../../generated/graphql'
|
||||
import { computed, onMounted } from 'vue'
|
||||
import { buildSpecTree } from '../../../specs/tree/useCollapsibleTree'
|
||||
import { useCollapsibleTree } from '../../tree/useCollapsibleTree'
|
||||
@@ -68,8 +68,8 @@ import type { FoundSpec } from '@packages/types/src'
|
||||
const { t } = useI18n()
|
||||
|
||||
gql`
|
||||
mutation ScaffoldGeneratorStepOne_scaffoldIntegration {
|
||||
scaffoldIntegration {
|
||||
mutation ScaffoldGeneratorStepOne_e2eExamples {
|
||||
e2eExamples {
|
||||
file {
|
||||
id
|
||||
absolute
|
||||
@@ -89,7 +89,7 @@ const emits = defineEmits<{
|
||||
(event: 'close'): void
|
||||
}>()
|
||||
|
||||
const mutation = useMutation(ScaffoldGeneratorStepOne_ScaffoldIntegrationDocument)
|
||||
const mutation = useMutation(ScaffoldGeneratorStepOne_E2eExamplesDocument)
|
||||
|
||||
onMounted(async () => {
|
||||
emits('update:title', t('createSpec.e2e.importFromScaffold.specsAddingHeader'))
|
||||
@@ -97,7 +97,7 @@ onMounted(async () => {
|
||||
emits('update:title', t('createSpec.e2e.importFromScaffold.specsAddedHeader'))
|
||||
})
|
||||
|
||||
const scaffoldedFiles = computed(() => mutation.data.value?.scaffoldIntegration || [])
|
||||
const scaffoldedFiles = computed(() => mutation.data.value?.e2eExamples || [])
|
||||
const specTree = computed(() => {
|
||||
const files: FoundSpec[] = scaffoldedFiles.value.map((res) => {
|
||||
return {
|
||||
|
||||
@@ -129,13 +129,13 @@ export class CodegenActions {
|
||||
return path.join(projectRoot, 'cypress', 'e2e')
|
||||
}
|
||||
|
||||
async scaffoldIntegration (): Promise<NexusGenObjects['ScaffoldedFile'][]> {
|
||||
async e2eExamples (): Promise<NexusGenObjects['ScaffoldedFile'][]> {
|
||||
const projectRoot = this.ctx.currentProject
|
||||
|
||||
assert(projectRoot, `Cannot create spec without currentProject.`)
|
||||
|
||||
const results = await codeGenerator(
|
||||
{ templateDir: templates['scaffoldIntegration'], target: this.defaultE2EPath },
|
||||
{ templateDir: templates['e2eExamples'], target: this.defaultE2EPath },
|
||||
{},
|
||||
)
|
||||
|
||||
|
||||
@@ -415,7 +415,7 @@ export class ProjectActions {
|
||||
|
||||
switch (this.ctx.coreData.currentTestingType) {
|
||||
case 'e2e':
|
||||
return hasNonExampleSpec(templates.scaffoldIntegration, specs)
|
||||
return hasNonExampleSpec(templates.e2eExamples, specs)
|
||||
case 'component':
|
||||
return specs.length > 0
|
||||
case null:
|
||||
|
||||
@@ -8,5 +8,5 @@ export default {
|
||||
vueComponent: getPath('./templates/vue-component'),
|
||||
componentEmpty: getPath('./templates/empty-component'),
|
||||
e2e: getPath('./templates/empty-e2e'),
|
||||
scaffoldIntegration: cypressEx.getPathToE2E(),
|
||||
e2eExamples: cypressEx.getPathToE2E(),
|
||||
} as const
|
||||
|
||||
@@ -319,10 +319,10 @@ describe('code-generator', () => {
|
||||
expect(() => babelParse(fileContent)).not.throw()
|
||||
})
|
||||
|
||||
it('should generate from scaffoldIntegration', async () => {
|
||||
it('should generate from e2eExamples', async () => {
|
||||
const target = path.join(tmpPath, 'scaffold-integration')
|
||||
const action: Action = {
|
||||
templateDir: templates.scaffoldIntegration,
|
||||
templateDir: templates.e2eExamples,
|
||||
target,
|
||||
}
|
||||
|
||||
@@ -368,12 +368,12 @@ describe('code-generator', () => {
|
||||
it('should return true after adding new spec file', async () => {
|
||||
const target = path.join(tmpPath, 'spec-check')
|
||||
|
||||
const checkBeforeScaffolding = await hasNonExampleSpec(templates.scaffoldIntegration, [])
|
||||
const checkBeforeScaffolding = await hasNonExampleSpec(templates.e2eExamples, [])
|
||||
|
||||
expect(checkBeforeScaffolding, 'expected having no spec files to show no non-example specs').to.be.false
|
||||
|
||||
const scaffoldExamplesAction: Action = {
|
||||
templateDir: templates.scaffoldIntegration,
|
||||
templateDir: templates.e2eExamples,
|
||||
target,
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ describe('code-generator', () => {
|
||||
|
||||
const specs = addTemplatesAsSpecs(scaffoldResults)
|
||||
|
||||
const checkAfterScaffolding = await hasNonExampleSpec(templates.scaffoldIntegration, specs)
|
||||
const checkAfterScaffolding = await hasNonExampleSpec(templates.e2eExamples, specs)
|
||||
|
||||
expect(checkAfterScaffolding, 'expected only having template files to show no non-example specs').to.be.false
|
||||
|
||||
@@ -404,7 +404,7 @@ describe('code-generator', () => {
|
||||
|
||||
const specsWithGenerated = [...specs, ...addTemplatesAsSpecs(generatedTest)]
|
||||
|
||||
const checkAfterTemplate = await hasNonExampleSpec(templates.scaffoldIntegration, specsWithGenerated)
|
||||
const checkAfterTemplate = await hasNonExampleSpec(templates.e2eExamples, specsWithGenerated)
|
||||
|
||||
expect(checkAfterTemplate, 'expected check after adding a new spec to indicate there are now non-example specs').to.be.true
|
||||
})
|
||||
|
||||
45
packages/errors/__snapshot-html__/EXPERIMENTAL_USE_DEFAULT_DOCUMENT_DOMAIN_E2E_ONLY.html
generated
Normal file
45
packages/errors/__snapshot-html__/EXPERIMENTAL_USE_DEFAULT_DOCUMENT_DOMAIN_E2E_ONLY.html
generated
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
|
||||
body {
|
||||
font-family: "Courier Prime", Courier, monospace;
|
||||
padding: 0 1em;
|
||||
line-height: 1.4;
|
||||
color: #eee;
|
||||
background-color: #111;
|
||||
}
|
||||
pre {
|
||||
padding: 0 0;
|
||||
margin: 0 0;
|
||||
font-family: "Courier Prime", Courier, monospace;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 5px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body><pre><span style="color:#e05561">The <span style="color:#e5e510">experimentalSkipDomainInjection<span style="color:#e05561"> experiment is currently only supported for End to End Testing and must be configured as an e2e testing type property: <span style="color:#de73ff">e2e.experimentalSkipDomainInjection<span style="color:#e05561">.<span style="color:#e6e6e6">
|
||||
<span style="color:#e05561">The suggested values are only a recommendation.<span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff">{<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff"> e2e: {<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff"> experimentalSkipDomainInjection: ['*.salesforce.com', '*.force.com', '*.google.com', 'google.com']<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff"> },<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff">}<span style="color:#e05561"><span style="color:#e6e6e6"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
|
||||
</pre></body></html>
|
||||
@@ -1,27 +1,30 @@
|
||||
# Example
|
||||
|
||||
## Scaffold config files
|
||||
This package is responsible for copying the `cypress/e2e` and `app` files from [`cypress-example-kitchensink`](https://github.com/cypress-io/cypress-example-kitchensink) into the cypress repository.
|
||||
|
||||
The `cypress/plugins/index.js`, `cypress/support/*` and `cypress/tsconfig.json` from this package are used for user scaffolding in `packages/server` and `npm/create-cypress-tests`. This configuration files are by default injected when user instals Cypress.
|
||||
The `cypress/e2e` tests, pulled into this package from the [kitchen sink app](https://github.com/cypress-io/cypress-example-kitchensink), are used for scaffolding user's e2e tests in `packages/data-context` and in `npm/create-cypress-tests`.
|
||||
|
||||
## Examples
|
||||
The `app` content, pulled into this package from the [kitchen sink app](https://github.com/cypress-io/cypress-example-kitchensink), is published to `cypress-io/cypress` repository's Github page, [https://example.cypress.io](https://example.cypress.io).
|
||||
|
||||
This repo contains the source code for pushing out [https://example.cypress.io](https://example.cypress.io).
|
||||
## Updating Content
|
||||
|
||||
The actual example repo you're probably looking for is [the kitchen sink app here](https://github.com/cypress-io/cypress-example-kitchensink).
|
||||
|
||||
**THERE'S LIKELY NO REASON YOU NEED TO EDIT ANY OF THE CODE ON THIS REPO.**
|
||||
**THERE'S LIKELY NO REASON YOU NEED TO EDIT ANY OF THE CODE IN THIS PACKAGE.**
|
||||
|
||||
- Want to edit the `example` tests? -> edit it [here](https://github.com/cypress-io/cypress-example-kitchensink/blob/master/cypress/e2e) instead.
|
||||
- Want to edit the actual [https://example.cypress.io](https://example.cypress.io) website? edit it [here](https://github.com/cypress-io/cypress-example-kitchensink/tree/master/app) instead.
|
||||
|
||||
## Updating the `example` app
|
||||
## Major Version Bumps of Cypress
|
||||
|
||||
After [releasing a new version](https://github.com/cypress-io/cypress-example-kitchensink/blob/master/CONTRIBUTING.md#deployment) on the [`cypress-example-kitchen-sink` repo](https://github.com/cypress-io/cypress-example-kitchensink/tree/master/cypress/e2e/2-advanced-examples), you now want to update the `example`'s dependency to match the newly released version.
|
||||
If any of the breaking changes in the next major release requires updates to Cypress commands or APIs, verify the site content in `cypress-example-kitchensink` is up-to-date and that all examples that will be scaffolded can successfully run with the breaking change.
|
||||
|
||||
## Using a new version of `cypress-example-kitchen-sink`
|
||||
|
||||
When a commit is merged into `master`, a new version of the [`cypress-example-kitchen-sink` repo](https://github.com/cypress-io/cypress-example-kitchensink/tree/master/cypress/e2e/2-advanced-examples) is released [automatically to npm](https://github.com/cypress-io/cypress-example-kitchensink/blob/master/CONTRIBUTING.md#deployment). When this happens, you will need to update the `example`'s dependency to match the newly released version.
|
||||
|
||||
1. Bump the `cypress-example-kitchensink` `devDependency` within this package's [`package.json`](https://github.com/cypress-io/cypress/blob/develop/packages/example/package.json).
|
||||
|
||||
2. Run `yarn` and `yarn workspace @packages/example` to build the app and spec files.
|
||||
CONTRIBUTING
|
||||
|
||||
3. Create a new pull-request following this repo's [pull request instructions](CONTRIBUTING.md#pull-requests).
|
||||
|
||||
## Building
|
||||
@@ -32,7 +35,7 @@ After running `yarn` you must build the app + spec files.
|
||||
yarn workspace @packages/example build
|
||||
```
|
||||
|
||||
This copies the src files from [`cypress-example-kitchensink`](https://github.com/cypress-io/cypress-example-kitchensink), modifies them to point to `https://example.cypress.io` and creates the `example` tests.
|
||||
This copies the `cypress/e2e` and files from [`cypress-example-kitchensink`](https://github.com/cypress-io/cypress-example-kitchensink), modifies them to point to `https://example.cypress.io` and creates the `example` tests.
|
||||
|
||||
## Deploying
|
||||
|
||||
|
||||
@@ -1,28 +1,29 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
const resolvePkg = require('resolve-pkg')
|
||||
const { join } = require('path')
|
||||
const fs = require('fs-extra')
|
||||
const path = require('path')
|
||||
const glob = require('glob')
|
||||
const util = require('util')
|
||||
const childProcess = require('child_process')
|
||||
|
||||
const EXAMPLE_DIR = path.join(__dirname, '..')
|
||||
const globAsync = util.promisify(glob)
|
||||
|
||||
async function build() {
|
||||
async function build () {
|
||||
await Promise.all([
|
||||
fs.remove(path.join(EXAMPLE_DIR, 'app')),
|
||||
fs.remove(path.join(EXAMPLE_DIR, 'cypress'))
|
||||
fs.remove(path.join(EXAMPLE_DIR, 'cypress')),
|
||||
])
|
||||
|
||||
await Promise.all([
|
||||
fs.copy(join(resolvePkg('cypress-example-kitchensink'), 'app'), path.join(EXAMPLE_DIR, 'app')),
|
||||
fs.copy(join(resolvePkg('cypress-example-kitchensink'), 'cypress'), path.join(EXAMPLE_DIR, 'cypress')),
|
||||
])
|
||||
|
||||
childProcess.execSync('node ./bin/convert.js', {
|
||||
cwd: EXAMPLE_DIR,
|
||||
stdio: 'inherit'
|
||||
stdio: 'inherit',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
module.exports = {
|
||||
"projectId": "2pz86o"
|
||||
'projectId': '2pz86o',
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/// <reference types="cypress" />
|
||||
// ***********************************************************
|
||||
// This example plugins/index.js can be used to load plugins
|
||||
//
|
||||
// You can change the location of this file or turn off loading
|
||||
// the plugins file with the 'pluginsFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/plugins-guide
|
||||
// ***********************************************************
|
||||
|
||||
// This function is called when a project is opened or re-opened (e.g. due to
|
||||
// the project's config changing)
|
||||
|
||||
/**
|
||||
* @type {Cypress.PluginConfig}
|
||||
*/
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
module.exports = (on, config) => {
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
const gulp = require('gulp')
|
||||
const ghPages = require('gulp-gh-pages')
|
||||
const gulpClean = require('gulp-clean')
|
||||
const RevAll = require('gulp-rev-all')
|
||||
|
||||
@@ -26,13 +25,6 @@ const clean = () => {
|
||||
.pipe(gulpClean())
|
||||
}
|
||||
|
||||
const pushGhPages = () => {
|
||||
return gulp.src('build/**/*')
|
||||
.pipe(ghPages())
|
||||
}
|
||||
|
||||
const build = gulp.series(clean, gulp.parallel(assets, cname))
|
||||
|
||||
exports.build = build
|
||||
|
||||
exports.deploy = gulp.series(build, pushGhPages)
|
||||
|
||||
2
packages/example/index.d.ts
vendored
2
packages/example/index.d.ts
vendored
@@ -1 +1 @@
|
||||
export { default } from './lib/example'
|
||||
export { default } from './lib/example'
|
||||
|
||||
8
packages/example/lib/example.d.ts
vendored
8
packages/example/lib/example.d.ts
vendored
@@ -1,9 +1,5 @@
|
||||
declare const example: {
|
||||
getPathToExamples(): Promise<string[]>;
|
||||
getPathToE2E(): string;
|
||||
getPathToPlugins(): string;
|
||||
getPathToTsConfig(): string;
|
||||
getPathToFixture(): string;
|
||||
getPathToE2E(): string
|
||||
}
|
||||
|
||||
export default example;
|
||||
export default example
|
||||
|
||||
@@ -1,38 +1,7 @@
|
||||
const path = require('path')
|
||||
const Promise = require('bluebird')
|
||||
const glob = Promise.promisify(require('glob'))
|
||||
|
||||
const pathToExamples = path.join(
|
||||
__dirname,
|
||||
'..',
|
||||
'cypress',
|
||||
'e2e',
|
||||
'**',
|
||||
'*'
|
||||
)
|
||||
|
||||
module.exports = {
|
||||
getPathToExamples () {
|
||||
return glob(pathToExamples, { nodir: true })
|
||||
},
|
||||
|
||||
getPathToE2E() {
|
||||
getPathToE2E () {
|
||||
return path.join(__dirname, '..', 'cypress', 'e2e')
|
||||
},
|
||||
|
||||
getPathToExampleFolders () {
|
||||
return glob(`${pathToExamples}${path.sep}`)
|
||||
},
|
||||
|
||||
getPathToPlugins() {
|
||||
return path.resolve(__dirname, '..', 'cypress', 'plugins', 'index.js')
|
||||
},
|
||||
|
||||
getPathToTsConfig() {
|
||||
return path.resolve(__dirname, '..', 'cypress', 'tsconfig.json')
|
||||
},
|
||||
|
||||
getPathToFixture() {
|
||||
return path.resolve(__dirname, '..', 'cypress', 'fixtures', 'example.json')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,30 +8,21 @@
|
||||
"clean-deps": "rimraf node_modules",
|
||||
"test": "yarn test-unit",
|
||||
"test-e2e": "cypress run",
|
||||
"test-debug": "yarn test-unit --inspect-brk=5566",
|
||||
"test-unit": "cross-env NODE_ENV=test mocha",
|
||||
"test-watch": "yarn test-unit --watch",
|
||||
"test-unit": "echo 'no unit tests'",
|
||||
"build": "node ./bin/build.js && gulp build",
|
||||
"build-prod": "yarn build",
|
||||
"predeploy": "yarn build",
|
||||
"deploy": "gulp deploy"
|
||||
},
|
||||
"dependencies": {
|
||||
"bluebird": "3.5.3",
|
||||
"glob": "7.1.3"
|
||||
"deploy": "echo 'gh-pages -d build -b gh-pages'"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "3.5.0",
|
||||
"cross-env": "6.0.3",
|
||||
"cypress-example-kitchensink": "https://github.com/cypress-io/cypress-example-kitchensink.git#d7150632ac15268f2c7a50110cadf039a248ac4e",
|
||||
"gulp": "4.0.2",
|
||||
"gulp-clean": "0.4.0",
|
||||
"gulp-gh-pages": "0.6.0-6",
|
||||
"gulp-rev-all": "2.0.2",
|
||||
"mocha": "2.5.3",
|
||||
"resolve-pkg": "2.0.0",
|
||||
"rimraf": "3.0.2",
|
||||
"shelljs": "0.8.5"
|
||||
"rimraf": "3.0.2"
|
||||
},
|
||||
"files": [
|
||||
"cypress",
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
let example = require('../index')
|
||||
let expect = require('chai').expect
|
||||
const path = require('path')
|
||||
const _ = require('lodash')
|
||||
|
||||
|
||||
const cwd = process.cwd()
|
||||
|
||||
/* global describe, it */
|
||||
describe('Cypress Example', function () {
|
||||
it('returns path to examples', function () {
|
||||
const expected = path.normalize(`${cwd}/cypress/e2e`)
|
||||
|
||||
return example.getPathToExamples()
|
||||
.then(expectToAllEqual(expected))
|
||||
})
|
||||
})
|
||||
|
||||
// ---
|
||||
function expectToAllEqual(expectedPath) {
|
||||
return (paths) => _.chain(paths)
|
||||
.map(result => {
|
||||
const pathParts = result.split(path.sep)
|
||||
return pathParts.slice(0, pathParts.length - 1)
|
||||
})
|
||||
.map(_.curry(path.join))
|
||||
.map(_.curry(path.normalize))
|
||||
.forEach(p => {
|
||||
expect(p).to.eq(path.normalize(expectedPath))
|
||||
})
|
||||
}
|
||||
@@ -107,7 +107,7 @@ export const stubMutation: MaybeResolver<Mutation> = {
|
||||
resetWizard (src, args, ctx) {
|
||||
return true
|
||||
},
|
||||
scaffoldIntegration (src, args, ctx) {
|
||||
e2eExamples (src, args, ctx) {
|
||||
return [{
|
||||
__typename: 'ScaffoldedFile',
|
||||
status: 'valid',
|
||||
|
||||
@@ -547,7 +547,7 @@ enum CodeGenType {
|
||||
component
|
||||
componentEmpty
|
||||
e2e
|
||||
scaffoldIntegration
|
||||
e2eExamples
|
||||
}
|
||||
|
||||
enum CodeLanguageEnum {
|
||||
@@ -1245,6 +1245,7 @@ type Mutation {
|
||||
|
||||
"""Dismisses a warning displayed by the frontend"""
|
||||
dismissWarning(id: ID!): Query
|
||||
e2eExamples: [ScaffoldedFile!]!
|
||||
|
||||
"""user has finished migration component specs - move to next step"""
|
||||
finishedRenamingComponentSpecs: Query
|
||||
@@ -1363,7 +1364,6 @@ type Mutation {
|
||||
|
||||
"""Reset the Wizard to the starting position"""
|
||||
resetWizard: Boolean!
|
||||
scaffoldIntegration: [ScaffoldedFile!]!
|
||||
scaffoldTestingType: Query
|
||||
setAndLoadCurrentTestingType(testingType: TestingTypeEnum!): Query
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ import { enumType } from 'nexus'
|
||||
|
||||
export const CodeGenTypeEnum = enumType({
|
||||
name: 'CodeGenType',
|
||||
members: ['component', 'componentEmpty', 'e2e', 'scaffoldIntegration'],
|
||||
members: ['component', 'componentEmpty', 'e2e', 'e2eExamples'],
|
||||
})
|
||||
|
||||
@@ -272,10 +272,10 @@ export const mutation = mutationType({
|
||||
},
|
||||
})
|
||||
|
||||
t.nonNull.list.nonNull.field('scaffoldIntegration', {
|
||||
t.nonNull.list.nonNull.field('e2eExamples', {
|
||||
type: ScaffoldedFile,
|
||||
resolve: (src, args, ctx) => {
|
||||
return ctx.actions.codegen.scaffoldIntegration()
|
||||
return ctx.actions.codegen.e2eExamples()
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
30
yarn.lock
30
yarn.lock
@@ -8877,9 +8877,9 @@ async@>=0.2.9, async@^3.2.0:
|
||||
integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==
|
||||
|
||||
async@^2.1.4, async@^2.4.1, async@^2.6.2:
|
||||
version "2.6.3"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff"
|
||||
integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==
|
||||
version "2.6.4"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221"
|
||||
integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==
|
||||
dependencies:
|
||||
lodash "^4.17.14"
|
||||
|
||||
@@ -15831,7 +15831,7 @@ getpass@^0.1.1:
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
gift@0.10.2, gift@^0.10.2:
|
||||
gift@0.10.2:
|
||||
version "0.10.2"
|
||||
resolved "https://registry.yarnpkg.com/gift/-/gift-0.10.2.tgz#4600efe8f284b51fcb01c3527b321e22b494e156"
|
||||
integrity sha512-wC9aKnQpjfOTWX+JG4DPJkS89ux6sl8EN4hXhv/2vBoXCDTEz1JiTeGTSeuKYlCqIgUFM1JwPVym34Sys3hvzw==
|
||||
@@ -16549,19 +16549,6 @@ gulp-debug@4.0.0:
|
||||
through2 "^2.0.0"
|
||||
tildify "^1.1.2"
|
||||
|
||||
gulp-gh-pages@0.6.0-6:
|
||||
version "0.6.0-6"
|
||||
resolved "https://registry.yarnpkg.com/gulp-gh-pages/-/gulp-gh-pages-0.6.0-6.tgz#e61eec05beb7f6151ce576a1c2cadfceffa45ae5"
|
||||
integrity sha512-9G3Z4THBrYaONcmy/3Z1t7Y0grzjcXH5YiZh/E+s4DREpfLBHy5qZyGLcc3R9hjDS/QJf+z3KfzWu8mhG6E0CA==
|
||||
dependencies:
|
||||
fancy-log "^1.3.2"
|
||||
gift "^0.10.2"
|
||||
inspect-with-kind "^1.0.4"
|
||||
plugin-error "^1.0.1"
|
||||
rimraf "^2.6.2"
|
||||
vinyl "^2.2.0"
|
||||
vinyl-fs "^3.0.3"
|
||||
|
||||
gulp-rename@1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/gulp-rename/-/gulp-rename-1.4.0.tgz#de1c718e7c4095ae861f7296ef4f3248648240bd"
|
||||
@@ -17642,13 +17629,6 @@ inquirer@^6.2.0:
|
||||
strip-ansi "^5.1.0"
|
||||
through "^2.3.6"
|
||||
|
||||
inspect-with-kind@^1.0.4:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/inspect-with-kind/-/inspect-with-kind-1.0.5.tgz#fce151d4ce89722c82ca8e9860bb96f9167c316c"
|
||||
integrity sha512-MAQUJuIo7Xqk8EVNP+6d3CKq9c80hi4tjIbIAT6lmGW9W6WzlHiu9PS8uSuUYU+Do+j1baiFp3H25XEVxDIG2g==
|
||||
dependencies:
|
||||
kind-of "^6.0.2"
|
||||
|
||||
internal-ip@^4.3.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-4.3.0.tgz#845452baad9d2ca3b69c635a137acb9a0dad0907"
|
||||
@@ -29744,7 +29724,7 @@ verror@^1.10.0:
|
||||
core-util-is "1.0.2"
|
||||
extsprintf "^1.2.0"
|
||||
|
||||
vinyl-fs@^3.0.0, vinyl-fs@^3.0.3:
|
||||
vinyl-fs@^3.0.0:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7"
|
||||
integrity sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==
|
||||
|
||||
Reference in New Issue
Block a user