Skip to content

Commit 6f773db

Browse files
committedJul 23, 2019
example test clock
0 parents  commit 6f773db

File tree

10 files changed

+1682
-0
lines changed

10 files changed

+1682
-0
lines changed
 

‎.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
cypress/videos

‎cypress.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

‎cypress/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Cypress.io end-to-end tests
2+
3+
[Cypress.io](https://www.cypress.io) is an open source, MIT licensed end-to-end test runner
4+
5+
## Folder structure
6+
7+
These folders hold end-to-end tests and supporting files for the Cypress Test Runner.
8+
9+
- [fixtures](fixtures) holds optional JSON data for mocking, [read more](https://on.cypress.io/fixture)
10+
- [integration](integration) holds the actual test files, [read more](https://on.cypress.io/writing-and-organizing-tests)
11+
- [plugins](plugins) allow you to customize how tests are loaded, [read more](https://on.cypress.io/plugins)
12+
- [support](support) file runs before all tests and is a great place to write or load additional custom commands, [read more](https://on.cypress.io/writing-and-organizing-tests#Support-file)
13+
14+
## `cypress.json` file
15+
16+
You can configure project options in the [../cypress.json](../cypress.json) file, see [Cypress configuration doc](https://on.cypress.io/configuration).
17+
18+
## More information
19+
20+
- [https://github.com/cypress.io/cypress](https://github.com/cypress.io/cypress)
21+
- [https://docs.cypress.io/](https://docs.cypress.io/)
22+
- [Writing your first Cypress test](http://on.cypress.io/intro)

‎cypress/fixtures/example.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "hello@cypress.io",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}

‎cypress/integration/spec.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// enables intelligent code completion for Cypress commands
2+
// https://on.cypress.io/intelligent-code-completion
3+
/// <reference types="Cypress" />
4+
5+
it('shows clock', function () {
6+
cy.visit('index.html')
7+
cy.wait(5000)
8+
cy.get('#clock').should('be.visible')
9+
})

‎cypress/plugins/index.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
}

‎cypress/support/index.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
// ***********************************************************

‎index.html

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<head>
2+
<style>
3+
body {
4+
font-size: xx-large;
5+
padding: 2em;
6+
}
7+
</style>
8+
</head>
9+
<body>
10+
<div id="clock"></div>
11+
<script>
12+
let clock = document.getElementById('clock')
13+
setInterval(() => {
14+
clock.innerText = performance.now().toFixed()
15+
}, 100)
16+
</script>
17+
</body>

‎package-lock.json

+1,579
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "cypress-test-clock",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1",
8+
"cy:open": "cypress open"
9+
},
10+
"keywords": [],
11+
"author": "",
12+
"license": "ISC",
13+
"devDependencies": {
14+
"cypress": "3.4.0"
15+
}
16+
}

0 commit comments

Comments
 (0)
Please sign in to comment.