Skip to content

Commit

Permalink
Ude default cypress directory
Browse files Browse the repository at this point in the history
  • Loading branch information
guidoderooij committed Mar 26, 2024
1 parent 4be55f1 commit bf5edb1
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 43 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ npm-debug.log
yarn-error.log
testem.log
/typings
/cypress
/cypress/downloads
/cypress/videos

# System Files
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"tsConfig": [
"projects/politie/ngx-sherlock/tsconfig.lib.json",
"projects/politie/ngx-sherlock/tsconfig.spec.json",
"projects/politie/ngx-sherlock/cypress/tsconfig.json"
"cypress/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
Expand Down
1 change: 0 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { defineConfig } from 'cypress'
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:4200',
specPattern: "e2e/cypress/**/*.cy.ts",
supportFile: false
},
})
24 changes: 12 additions & 12 deletions e2e/cypress/e2e/spec.cy.ts → cypress/e2e/spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,44 @@ const noRetries = {

describe('workspace-project App', () => {
it('Visits the initial project page', () => {
cy.visit('/')
cy.get('app-root h1').contains('Welcome to the demo of @politie/ngx-sherlock')
})
cy.visit('/');
cy.get('app-root h1').contains('Welcome to the demo of @politie/ngx-sherlock');
});

it('should update the auto changedetection every second', { retries: noRetries }, done => {
cy.visit('/')
cy.visit('/');
checkTime(getAutoCDClock, done);
});

it('should update the value pipe every second', { retries: noRetries }, done => {
cy.visit('/')
cy.visit('/');
checkTime(getPipeClock, done);
});

it('should update the value proxy pipe every second', { retries: noRetries }, done => {
cy.visit('/')
cy.visit('/');
checkTime(getProxyPipeClock, done);
});
})
});

const checkTime = (func: () => Cypress.Chainable<JQuery<HTMLElement>>, done: Mocha.Done) => {
func().invoke('text').then((timeFirst) => {
cy.wait(1100);
func().invoke('text').then((timeSecond) => {
expect(timeSecond).not.to.equal(timeFirst);
done();
})
});
});
}
};

const getAutoCDClock = () => {
return cy.get('app-auto-change-detection-service time').first();
}
};

const getPipeClock = () => {
return cy.get('app-value-pipe time.base-clock').first();
}
};

const getProxyPipeClock = () => {
return cy.get('app-value-pipe time.base-clock').last();
}
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/cypress/tsconfig.json → cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../tsconfig.json",
"include": ["**/*.ts"],
"compilerOptions": {
"sourceMap": false,
Expand Down
11 changes: 0 additions & 11 deletions e2e/cypress.config.ts

This file was deleted.

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

This file was deleted.

3 changes: 0 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"importHelpers": true,
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
Expand Down

0 comments on commit bf5edb1

Please sign in to comment.