GeezerVison is showing github.com — Add Cypress E2E env and first test for local & ci · feidianbo/angular-split@1088e85
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: angular.json -28Lines changed: 0 additions & 28 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 107 | 107 | } | 108 | 108 | } | 109 | 109 | }, | 110 | | - "angular-split-app-e2e": { | 111 | | - "root": "e2e/", | 112 | | - "projectType": "application", | 113 | | - "prefix": "", | 114 | | - "architect": { | 115 | | - "e2e": { | 116 | | - "builder": "@angular-devkit/build-angular:protractor", | 117 | | - "options": { | 118 | | - "protractorConfig": "e2e/protractor.conf.js", | 119 | | - "devServerTarget": "angular-split-app:serve" | 120 | | - }, | 121 | | - "configurations": { | 122 | | - "production": { | 123 | | - "devServerTarget": "angular-split-app:serve:production" | 124 | | - } | 125 | | - } | 126 | | - }, | 127 | | - "lint": { | 128 | | - "builder": "@angular-devkit/build-angular:tslint", | 129 | | - "options": { | 130 | | - "tsConfig": "e2e/tsconfig.e2e.json", | 131 | | - "exclude": [ | 132 | | - "**/node_modules/**" | 133 | | - ] | 134 | | - } | 135 | | - } | 136 | | - } | 137 | | - }, | 138 | 110 | "angular-split": { | 139 | 111 | "root": "projects/angular-split", | 140 | 112 | "sourceRoot": "projects/angular-split/src", | |
Collapse file Copy file name to clipboard +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +{} |
Collapse file Copy file name to clipboard +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +{ | | 2 | + "name": "Using fixtures to represent data", | | 3 | + | | 4 | + "body": "Fixtures are a great way to mock data for responses to routes" | | 5 | +} |
Collapse file Copy file name to clipboard +29Lines changed: 29 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +/// <reference types="Cypress" /> | | 2 | + | | 3 | +context('Direction change', () => { | | 4 | + beforeEach(() => { | | 5 | + cy.visit('http://localhost:4200/#/examples/simple-split') | | 6 | + }) | | 7 | + | | 8 | + it('cy.viewport() - set the viewport size and dimension', () => { | | 9 | + cy.viewport(800, 600); | | 10 | + | | 11 | + const W = 650; | | 12 | + const H = 300; | | 13 | + const GUTTER = 11; | | 14 | + | | 15 | + cy.get('as-split').should('have.css', 'flex-direction', 'row'); | | 16 | + cy.get('as-split-area[size="30"]').should('have.css', 'height', `${ H }px`); | | 17 | + cy.get('as-split-area[size="30"]').should('have.css', 'flex', '0 0 calc(-3.3px + 30%)'); | | 18 | + cy.get('as-split-area[size="70"]').should('have.css', 'height', `${ H }px`); | | 19 | + cy.get('as-split-area[size="70"]').should('have.css', 'flex', '0 0 calc(-7.7px + 70%)'); | | 20 | + | | 21 | + cy.get('.btns > .btn').click(); | | 22 | + | | 23 | + cy.get('as-split').should('have.css', 'flex-direction', 'column'); | | 24 | + cy.get('as-split-area[size="30"]').should('have.css', 'width', `${ W }px`); | | 25 | + cy.get('as-split-area[size="30"]').should('have.css', 'flex', '0 0 calc(-3.3px + 30%)'); | | 26 | + cy.get('as-split-area[size="70"]').should('have.css', 'width', `${ W }px`); | | 27 | + cy.get('as-split-area[size="70"]').should('have.css', 'flex', '0 0 calc(-7.7px + 70%)'); | | 28 | + }) | | 29 | +}) |
Collapse file Copy file name to clipboard +17Lines changed: 17 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +// *********************************************************** | | 2 | +// This example plugins/index.js can be used to load plugins | | 3 | +// | | 4 | +// You can change the location of this file or turn off loading | | 5 | +// the plugins file with the 'pluginsFile' configuration option. | | 6 | +// | | 7 | +// You can read more here: | | 8 | +// https://on.cypress.io/plugins-guide | | 9 | +// *********************************************************** | | 10 | + | | 11 | +// This function is called when a project is opened or re-opened (e.g. due to | | 12 | +// the project's config changing) | | 13 | + | | 14 | +module.exports = (on, config) => { | | 15 | + // `on` is used to hook into various events Cypress emits | | 16 | + // `config` is the resolved Cypress config | | 17 | +} |
Collapse file Copy file name to clipboard +25Lines changed: 25 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +// *********************************************** | | 2 | +// This example commands.js shows you how to | | 3 | +// create various custom commands and overwrite | | 4 | +// existing commands. | | 5 | +// | | 6 | +// For more comprehensive examples of custom | | 7 | +// commands please read more here: | | 8 | +// https://on.cypress.io/custom-commands | | 9 | +// *********************************************** | | 10 | +// | | 11 | +// | | 12 | +// -- This is a parent command -- | | 13 | +// Cypress.Commands.add("login", (email, password) => { ... }) | | 14 | +// | | 15 | +// | | 16 | +// -- This is a child command -- | | 17 | +// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) | | 18 | +// | | 19 | +// | | 20 | +// -- This is a dual command -- | | 21 | +// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) | | 22 | +// | | 23 | +// | | 24 | +// -- This is will overwrite an existing command -- | | 25 | +// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) |
Collapse file Copy file name to clipboard +20Lines changed: 20 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +// *********************************************************** | | 2 | +// This example support/index.js is processed and | | 3 | +// loaded automatically before your test files. | | 4 | +// | | 5 | +// This is a great place to put global configuration and | | 6 | +// behavior that modifies Cypress. | | 7 | +// | | 8 | +// You can change the location of this file or turn off | | 9 | +// automatically serving support files with the | | 10 | +// 'supportFile' configuration option. | | 11 | +// | | 12 | +// You can read more here: | | 13 | +// https://on.cypress.io/configuration | | 14 | +// *********************************************************** | | 15 | + | | 16 | +// Import commands.js using ES2015 syntax: | | 17 | +import './commands' | | 18 | + | | 19 | +// Alternatively you can use CommonJS syntax: | | 20 | +// require('./commands') |
Collapse file Copy file name to clipboardExpand all lines: e2e/protractor.conf.js -28Lines changed: 0 additions & 28 deletions Collapse file Copy file name to clipboardExpand all lines: e2e/src/app.e2e-spec.ts -14Lines changed: 0 additions & 14 deletions Collapse file Copy file name to clipboardExpand all lines: e2e/src/app.po.ts -11Lines changed: 0 additions & 11 deletions
|