Skip to content

Commit

Permalink
feat(webapp-e2e): switching from testcafe to cypress for e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Feb 21, 2019
1 parent ca53594 commit cfecbf8
Show file tree
Hide file tree
Showing 23 changed files with 5,895 additions and 7,063 deletions.
51 changes: 51 additions & 0 deletions .github/main.workflow
@@ -0,0 +1,51 @@
workflow "Main" {
on = "push"
resolves = [
"Test",
"GitHub Action for Firebase",
"Prebuild libraries",
"Install dependencies",
]
}

action "Select master branch" {
uses = "actions/bin/filter@master"
args = "branch master"
}

action "Install dependencies" {
uses = "actions/npm@59b64a598378f31e49cb76f27d6f3312b582f680"
needs = ["Select master branch"]
args = "install"
}

action "Prebuild libraries" {
uses = "actions/npm@59b64a598378f31e49cb76f27d6f3312b582f680"
needs = ["Install dependencies"]
args = "run prebuild"
}

action "Lint" {
uses = "actions/npm@59b64a598378f31e49cb76f27d6f3312b582f680"
needs = ["Prebuild libraries"]
args = "run lint"
}

action "Test" {
uses = "actions/npm@59b64a598378f31e49cb76f27d6f3312b582f680"
needs = ["Prebuild libraries"]
args = "run test"
}

action "Build" {
uses = "actions/npm@59b64a598378f31e49cb76f27d6f3312b582f680"
needs = ["Lint", "Test"]
args = "run build"
}

action "GitHub Action for Firebase" {
uses = "w9jds/firebase-action@7d6b2b058813e1224cdd4db255b2f163ae4084d3"
needs = ["Build"]
secrets = ["FIREBASE_TOKEN", "PROJECT_ID"]
args = "deploy"
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
@@ -0,0 +1,8 @@
{
"recommendations": [
"nrwl.angular-console",
"angular.ng-template",
"ms-vscode.vscode-typescript-tslint-plugin",
"esbenp.prettier-vscode"
]
}
6 changes: 0 additions & 6 deletions apps/api/nodemon-debug.json

This file was deleted.

6 changes: 0 additions & 6 deletions apps/api/nodemon.json

This file was deleted.

11 changes: 11 additions & 0 deletions apps/webapp-e2e/cypress.json
@@ -0,0 +1,11 @@
{
"fileServerFolder": "../../dist/out-tsc/apps/webapp-e2e",
"fixturesFolder": "../../dist/out-tsc/apps/webapp-e2e/src/fixtures",
"integrationFolder": "../../dist/out-tsc/apps/webapp-e2e/src/integration",
"pluginsFile": "../../dist/out-tsc/apps/webapp-e2e/src/plugins/index.js",
"supportFile": false,
"video": true,
"videosFolder": "../../dist/out-tsc/apps/webapp-e2e/videos",
"screenshotsFolder": "../../dist/out-tsc/apps/webapp-e2e/screenshots",
"chromeWebSecurity": false
}
16 changes: 0 additions & 16 deletions apps/webapp-e2e/src/app.e2e-spec.ts

This file was deleted.

1 change: 0 additions & 1 deletion apps/webapp-e2e/src/environment.ts

This file was deleted.

4 changes: 4 additions & 0 deletions apps/webapp-e2e/src/fixtures/example.json
@@ -0,0 +1,4 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io"
}
9 changes: 9 additions & 0 deletions apps/webapp-e2e/src/integration/app.spec.ts
@@ -0,0 +1,9 @@
import { getGreeting } from '../support/app.po';

describe('Hello Nx', () => {
beforeEach(() => cy.visit('/'));

it('should display welcome message', () => {
getGreeting().contains('Welcome to webapp!');
});
});
32 changes: 0 additions & 32 deletions apps/webapp-e2e/src/login.e2e-spec.ts

This file was deleted.

51 changes: 0 additions & 51 deletions apps/webapp-e2e/src/navbar.e2e-spec.ts

This file was deleted.

17 changes: 17 additions & 0 deletions apps/webapp-e2e/src/plugins/index.ts
@@ -0,0 +1,17 @@
// ***********************************************************
// 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)

module.exports = (on: any, config: any) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
};
13 changes: 0 additions & 13 deletions apps/webapp-e2e/src/po/app.po.ts

This file was deleted.

15 changes: 0 additions & 15 deletions apps/webapp-e2e/src/po/login.po.ts

This file was deleted.

26 changes: 0 additions & 26 deletions apps/webapp-e2e/src/po/navbar.po.ts

This file was deleted.

1 change: 1 addition & 0 deletions apps/webapp-e2e/src/support/app.po.ts
@@ -0,0 +1 @@
export const getGreeting = () => cy.get('h1');
25 changes: 25 additions & 0 deletions apps/webapp-e2e/src/support/commands.ts
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
17 changes: 17 additions & 0 deletions apps/webapp-e2e/src/support/index.ts
@@ -0,0 +1,17 @@
// ***********************************************************
// This example support/index.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';
9 changes: 0 additions & 9 deletions apps/webapp-e2e/src/utils/browser.ts

This file was deleted.

5 changes: 0 additions & 5 deletions apps/webapp-e2e/src/utils/index.ts

This file was deleted.

16 changes: 3 additions & 13 deletions apps/webapp-e2e/tsconfig.e2e.json
@@ -1,18 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc/apps/webapp-e2e",
"module": "commonjs",
"target": "es5",
"types": ["jest", "node"]
"sourceMap": false,
"outDir": "../../dist/out-tsc/apps/webapp-e2e/src"
},
"include": [
"**/*.ts",
"../../libs/home/src/index.ts",
"../../libs/dashboard/src/index.ts",
"../../libs/experiments/src/index.ts",
"../../libs/widgets/src/index.ts",
"../../libs/grid/src/index.ts",
"../../libs/not-found/src/index.ts"
]
"include": ["src/**/*.ts"]
}
8 changes: 3 additions & 5 deletions apps/webapp-e2e/tsconfig.json
@@ -1,9 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": [
"jest",
"node"
]
}
"types": ["cypress", "node"]
},
"include": ["**/*.ts"]
}

0 comments on commit cfecbf8

Please sign in to comment.