Skip to content

Commit

Permalink
Migrate e2e tests to Cypress (kubernetes#4002)
Browse files Browse the repository at this point in the history
* installed cypress and added sample test

* readd aot compilation
  • Loading branch information
eloyekunle authored and k8s-ci-robot committed Aug 1, 2019
1 parent 81942b6 commit 4f15d0e
Show file tree
Hide file tree
Showing 18 changed files with 822 additions and 508 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ node_modules/
.cached_tools/
dist/
coverage/
cypress/screenshots
cypress/videos

# System specific files:
.DS_Store
Expand Down
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ git:
cache:
directories:
- .cached_tools
- ~/.cache
- node_modules

before_install:
Expand All @@ -25,7 +26,7 @@ before_script:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge"
- sudo apt-get update
- sudo apt-get -y install docker-ce
- sudo apt-get -y install docker-ce libgconf2-4
- sudo service docker restart
- docker --version

Expand All @@ -37,7 +38,7 @@ jobs:
after_success:
- rm -rf $TRAVIS_BUILD_DIR/.tmp
- bash <(curl -s https://codecov.io/bash)
- script: npm run cluster:start && npm run test:e2e
- script: npm run cluster:start && npm run e2e
- stage: deploy
script:
- docker login -u $DOCKER_USER -p $DOCKER_PASS
Expand Down
71 changes: 0 additions & 71 deletions aio/protractor.conf.js

This file was deleted.

16 changes: 0 additions & 16 deletions aio/tsconfig.e2e.json

This file was deleted.

22 changes: 0 additions & 22 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,28 +101,6 @@
}
}
},
"kubernetes-dashboard-e2e": {
"root": "",
"sourceRoot": "",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "aio/protractor.conf.js",
"devServerTarget": "kubernetes-dashboard:serve",
"webdriverUpdate": false
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [],
"exclude": []
}
}
}
}
},
"defaultProject": "kubernetes-dashboard",
"schematics": {
Expand Down
6 changes: 6 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"baseUrl": "http://localhost:8080",
"video": false,
"viewportWidth": 1920,
"viewportHeight": 1080
}
Empty file added cypress/fixtures/.keep
Empty file.
3 changes: 3 additions & 0 deletions cypress/fixtures/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixtures are mock data used during tests, promoting repeatability.

You can read more here: https://github.com/cypress-io/cypress-example-recipes/tree/master/examples/fundamentals__fixtures
15 changes: 15 additions & 0 deletions cypress/integration/basic.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
describe("Application", () => {
before(() => {
cy.visit("/");
});

it("visits 'default' namespace", () => {
cy.url().should('include', 'overview?namespace=default');
});

it("collapses sidebar", () => {
cy.get("mat-drawer").should("be.visible");
cy.get("kd-nav-hamburger").click();
cy.get("mat-drawer").should('not.be.visible');
})
});
3 changes: 3 additions & 0 deletions cypress/plugins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The `plugins/index.js` file is used to load plugins.

You can read more here: https://on.cypress.io/plugins-guide
4 changes: 4 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
};
5 changes: 5 additions & 0 deletions cypress/support/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The `support/index.js` is processed and
loaded automatically before the test files.

This is the place to put global configuration and
behavior that modifies Cypress.
3 changes: 3 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// ***********************************************
// Create various custom commands and overwrite existing commands.
// ***********************************************
1 change: 1 addition & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './commands'
Loading

0 comments on commit 4f15d0e

Please sign in to comment.