Skip to content

Commit

Permalink
So long and thanks for all the fish, protractor!
Browse files Browse the repository at this point in the history
  • Loading branch information
mpalourdio committed Sep 25, 2022
1 parent ea123fd commit 0394ab7
Show file tree
Hide file tree
Showing 10 changed files with 4,937 additions and 5,380 deletions.
13 changes: 6 additions & 7 deletions angular.json
Expand Up @@ -121,19 +121,18 @@
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"builder": "@cypress/schematic:cypress",
"options": {
"protractorConfig": "e2e/protractor.conf.js"
"devServerTarget": "ng2:serve",
"browser": "chromium",
"watch": false,
"record": false
},
"configurations": {
"production": {
"devServerTarget": "ng2:serve:production"
},
"development": {
"devServerTarget": "ng2:serve:development"
}
},
"defaultConfiguration": "development"
}
}
}
}
Expand Down
37 changes: 37 additions & 0 deletions cypress.config.ts
@@ -0,0 +1,37 @@
import { defineConfig } from 'cypress';
import Browser = Cypress.Browser;

const puppeteer = require('puppeteer');

const findPuppeteer: () => Promise<Browser> = async () => {
const browserPath = puppeteer.executablePath();
const browser = await puppeteer.launch();
const version = await browser.version();
const majorVersion = parseInt(version.split('/')[1]);

return {
name: 'chromium',
family: 'chromium',
displayName: `Puppeteer - ${version}`,
version: version,
majorVersion: majorVersion,
path: browserPath,
channel: 'stable',
isHeaded: false,
isHeadless: true,
};
};

export default defineConfig({
e2e: {
'baseUrl': 'http://localhost:4200',
supportFile: false,
video: false,
setupNodeEvents: (on, config) => {
return findPuppeteer().then((browser) => {
config.browsers.push(browser);
return config;
});
},
},
});
6 changes: 6 additions & 0 deletions cypress/e2e/spec.cy.ts
@@ -0,0 +1,6 @@
describe('My First Test', () => {
it('should display message saying hello world', () => {
cy.visit('/');
cy.contains('Hello World!');
});
});
8 changes: 8 additions & 0 deletions cypress/tsconfig.json
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.json",
"include": ["**/*.ts"],
"compilerOptions": {
"sourceMap": false,
"types": ["cypress"]
}
}
61 changes: 0 additions & 61 deletions e2e/protractor.conf.js

This file was deleted.

14 changes: 0 additions & 14 deletions e2e/src/app.e2e-spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions e2e/src/app.po.ts

This file was deleted.

13 changes: 0 additions & 13 deletions e2e/tsconfig.json

This file was deleted.

0 comments on commit 0394ab7

Please sign in to comment.