Skip to content
This repository was archived by the owner on Feb 28, 2023. It is now read-only.

Commit ca4d435

Browse files
authored
switch slides to use Reveal and Vite (#247)
1 parent 1ee93dc commit ca4d435

File tree

52 files changed

+656
-789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+656
-789
lines changed

README.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -87,39 +87,41 @@ See the presentation at [https://gitpitch.com/cypress-io/testing-workshop-cypres
8787

8888
| | topic | folder | contents | slides |
8989
| --- | -------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ------ |
90-
| [🔗](#intro) | Introduction, TodoMVC application | [todomvc](todomvc) | [intro.md](slides/intro/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/intro)
91-
| [🔗](#start) | Loading page | [00-start](00-start) | [00-start](slides/00-start/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/00-start)
92-
| [🔗](#basic) | `cypress open` vs `cypress run` | [01-basic](cypress/integration/01-basic) | [01-basic](slides/01-basic/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/01-basic)
93-
| [🔗](#adding-items) | Adding items test, `cypress.json` file | [02-adding-items](cypress/integration/02-adding-items) | [02-adding-items](slides/02-adding-items/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/02-adding-items)
94-
| [🔗](#selector-playground) | Selector Playground | [03-selector-playground](cypress/integration/03-selector-playground) | [03-selector-playground](slides/03-selector-playground/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/03-selector-playground)
95-
| [🔗](#reset-state) | Reset database using `cy.request` | [04-reset-state](cypress/integration/04-reset-state) | [04-reset-state](slides/04-reset-state/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/04-reset-state)
96-
| [🔗](#xhr) | Spy and stub XHR requests, fixtures | [05-xhr](cypress/integration/05-xhr) | [05-xhr](slides/05-xhr/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/05-xhr)
97-
| [🔗](#app-data-store) | Access application code and data | [06-app-data-store](cypress/integration/06-app-data-store) | [06-app-data-store](slides/06-app-data-store/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/06-app-data-store)
90+
| [🔗](#intro) | Introduction, TodoMVC application | [todomvc](todomvc) | [intro.md](slides/intro/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/intro)
91+
| [🔗](#start) | Loading page | [00-start](00-start) | [00-start](slides/00-start/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/00-start)
92+
| [🔗](#basic) | `cypress open` vs `cypress run` | [01-basic](cypress/integration/01-basic) | [01-basic](slides/01-basic/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/01-basic)
93+
| [🔗](#adding-items) | Adding items test, `cypress.json` file | [02-adding-items](cypress/integration/02-adding-items) | [02-adding-items](slides/02-adding-items/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/02-adding-items)
94+
| [🔗](#selector-playground) | Selector Playground | [03-selector-playground](cypress/integration/03-selector-playground) | [03-selector-playground](slides/03-selector-playground/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/03-selector-playground)
95+
| [🔗](#reset-state) | Reset database using `cy.request` | [04-reset-state](cypress/integration/04-reset-state) | [04-reset-state](slides/04-reset-state/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/04-reset-state)
96+
| [🔗](#xhr) | Spy and stub XHR requests, fixtures | [05-xhr](cypress/integration/05-xhr) | [05-xhr](slides/05-xhr/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/05-xhr)
97+
| [🔗](#app-data-store) | Access application code and data | [06-app-data-store](cypress/integration/06-app-data-store) | [06-app-data-store](slides/06-app-data-store/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/06-app-data-store)
9898

9999
### Intermediate
100100
| | topic | folder | contents | slides |
101101
| --- | -------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ------ |
102-
| [🔗](#ci) | Setting up E2E tests on CI | [07-ci](cypress/integration/07-ci) | [07-ci](slides/07-ci/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/07-ci)
103-
| [🔗](#dashboard) | Setting up Cypress Dashboard | [07-ci](cypress/integration/07-ci) | [08-dashboard](slides/08-dashboard/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/08-dashboard)
104-
| [🔗](#reporters) | Test reporters | - | [09-reporters](slides/09-reporters/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/09-reporters)
105-
| [🔗](#configuration) | Configuration | - | [10-configuration](slides/10-configuration/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/10-configuration)
106-
| [🔗](#retry-ability) | Retry-ability | [11-retry-ability](cypress/integration/11-retry-ability) | [11-retry-ability](slides/11-retry-ability/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/11-retry-ability)
107-
| [🔗](#custom-commands) | Custom commands | [12-custom-commands](cypress/integration/12-custom-commands) | [12-custom-commands](slides/12-custom-commands/PITCHME.md)| [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/12-custom-commands)
102+
| [🔗](#ci) | Setting up E2E tests on CI | [07-ci](cypress/integration/07-ci) | [07-ci](slides/07-ci/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/07-ci)
103+
| [🔗](#dashboard) | Setting up Cypress Dashboard | [07-ci](cypress/integration/07-ci) | [08-dashboard](slides/08-dashboard/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/08-dashboard)
104+
| [🔗](#reporters) | Test reporters | - | [09-reporters](slides/09-reporters/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/09-reporters)
105+
| [🔗](#configuration) | Configuration | - | [10-configuration](slides/10-configuration/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/10-configuration)
106+
| [🔗](#retry-ability) | Retry-ability | [11-retry-ability](cypress/integration/11-retry-ability) | [11-retry-ability](slides/11-retry-ability/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/11-retry-ability)
107+
| [🔗](#custom-commands) | Custom commands | [12-custom-commands](cypress/integration/12-custom-commands) | [12-custom-commands](slides/12-custom-commands/PITCHME.md)| [link](https://testing-workshop-cypress.netlify.app?p=slides/12-custom-commands)
108108

109109
### Advanced
110110
| | topic | folder | contents | slides |
111111
| --- | -------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ------ |
112-
| [🔗](#app-actions) | Page Objects vs App Actions | [13-app-actions](cypress/integration/13-app-actions) | [13-app-actions](slides/13-app-actions/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/13-app-actions)
113-
| [🔗](#fixtures) | Fixtures | [14-fixtures](cypress/integration/14-fixtures) | [14-fixtures](slides/14-fixtures/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/14-fixtures)
114-
| [🔗](#debugging) | Debugging | [02-adding-items/demo.js](cypress/integration/02-adding-items/demo.js) | [15-debugging](slides/15-debugging/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/15-debugging)
115-
| [🔗](#preprocessors) | Preprocessors | [16-preprocessors](cypress/integration/16-preprocessors) | [16-preprocessors](slides/16-preprocessors/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/16-preprocessors)
116-
| [🔗](#component-testing) | Component testing | [17-component-testing](cypress/integration/17-component-testing) | [17-component-testing](slides/17-component-testing/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/17-component-testing)
117-
| [🔗](#backend) | Backend code | [18-backend](cypress/integration/18-backend) | [18-backend](slides/18-backend/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/18-backend)
118-
| [🔗](#code-coverage) | Code coverage | [19-code-coverage](cypress/integration/19-code-coverage) | [19-code-coverage](slides/19-code-coverage/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/19-code-coverage)
119-
| | The end | - | [end](slides/end/PITCHME.md) | [link](https://gitpitch.com/cypress-io/testing-workshop-cypress?p=slides/end)
112+
| [🔗](#app-actions) | Page Objects vs App Actions | [13-app-actions](cypress/integration/13-app-actions) | [13-app-actions](slides/13-app-actions/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/13-app-actions)
113+
| [🔗](#fixtures) | Fixtures | [14-fixtures](cypress/integration/14-fixtures) | [14-fixtures](slides/14-fixtures/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/14-fixtures)
114+
| [🔗](#debugging) | Debugging | [02-adding-items/demo.js](cypress/integration/02-adding-items/demo.js) | [15-debugging](slides/15-debugging/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/15-debugging)
115+
| [🔗](#preprocessors) | Preprocessors | [16-preprocessors](cypress/integration/16-preprocessors) | [16-preprocessors](slides/16-preprocessors/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/16-preprocessors)
116+
| [🔗](#component-testing) | Component testing | [17-component-testing](cypress/integration/17-component-testing) | [17-component-testing](slides/17-component-testing/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/17-component-testing)
117+
| [🔗](#backend) | Backend code | [18-backend](cypress/integration/18-backend) | [18-backend](slides/18-backend/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/18-backend)
118+
| [🔗](#code-coverage) | Code coverage | [19-code-coverage](cypress/integration/19-code-coverage) | [19-code-coverage](slides/19-code-coverage/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/19-code-coverage)
119+
| | The end | - | [end](slides/end/PITCHME.md) | [link](https://testing-workshop-cypress.netlify.app?p=slides/end)
120120

121121
## For speakers 🎙
122122

123+
[![Netlify Status](https://api.netlify.com/api/v1/badges/de48e52e-e2ee-4092-a626-ab4fa358e441/deploy-status)](https://app.netlify.com/sites/testing-workshop-cypress/deploys)
124+
123125
This workshop can take all day, but you can pick the sections you are interested in teaching at will and customize it into any time duration. Everyone is coding for the most part, except for CI and the Cypress Dashboard sections, where the usage was shown via slides and actual sites.
124126

125127
During the workshop, keep the `todomvc` app running in one shell, while each section `01-basic`, `02-...`, `03-...` etc. has its own Cypress and specs subfolders `cypress/integration/...`. Usually a spec has several tests with placeholder comments. The workshop attendees are expected to make the tests pass using the knowledge from the slides and hints (and [Cypress documentation](https://docs.cypress.io/)). Note that most folders have a prepared `spec.js` file and an `answer.js` file. The `answer.js` file is ignored by Cypress using a setting in `cypress.json`.

cypress/integration/02-adding-items/answer.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ it('can mark an item as completed', () => {
2424
addItem('hard')
2525

2626
// marks the first item as completed
27-
cy.contains('li.todo', 'simple')
28-
.should('exist')
29-
.find('.toggle')
30-
.check()
27+
cy.contains('li.todo', 'simple').should('exist').find('.toggle').check()
3128

3229
// confirms the first item has the expected completed class
3330
cy.contains('li.todo', 'simple').should('have.class', 'completed')
@@ -56,7 +53,7 @@ it('can delete an item', () => {
5653
* Adds a todo item
5754
* @param {string} text
5855
*/
59-
const addItem = text => {
56+
const addItem = (text) => {
6057
cy.get('.new-todo').type(`${text}{enter}`)
6158
}
6259

@@ -72,9 +69,7 @@ it('can add many items', () => {
7269
})
7370

7471
it('adds item with random text', () => {
75-
const randomLabel = `Item ${Math.random()
76-
.toString()
77-
.slice(2, 14)}`
72+
const randomLabel = `Item ${Math.random().toString().slice(2, 14)}`
7873

7974
addItem(randomLabel)
8075
cy.contains('li.todo', randomLabel)
@@ -87,7 +82,7 @@ it('starts with zero items', () => {
8782
})
8883

8984
it('does not allow adding blank todos', () => {
90-
cy.on('uncaught:exception', e => {
85+
cy.on('uncaught:exception', (e) => {
9186
// what will happen if this assertion fails?
9287
// will the test fail?
9388
// expect(e.message).to.include('Cannot add a blank todo')

cypress/integration/02-adding-items/demo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ beforeEach(function visitSite() {
1515
cy.visit('/')
1616
})
1717

18-
it('adds items', function() {
18+
it('adds items', function () {
1919
cy.get('.new-todo')
2020
.type('todo A{enter}')
2121
.type('todo B{enter}')

cypress/integration/03-selector-playground/answer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ it('loads', () => {
66
cy.contains('h1', 'todos')
77
})
88
// optional test data attribute selector helper
9-
const tid = id => `[data-cy="${id}"]`
9+
const tid = (id) => `[data-cy="${id}"]`
1010
/**
1111
* Adds a todo item
1212
* @param {string} text
1313
*/
14-
const addItem = text => {
14+
const addItem = (text) => {
1515
cy.get('[data-cy="input"]').type(`${text}{enter}`)
1616
}
1717

cypress/integration/03-selector-playground/spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ it('loads', () => {
1515
* Adds a todo item
1616
* @param {string} text
1717
*/
18-
const addItem = text => {
18+
const addItem = (text) => {
1919
// write Cy commands here to add the new item
2020
}
2121
it('adds two items', () => {

cypress/integration/04-reset-state/answer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Adds a todo item
44
* @param {string} text
55
*/
6-
const addItem = text => {
6+
const addItem = (text) => {
77
cy.get('.new-todo').type(`${text}{enter}`)
88
}
99

@@ -76,7 +76,7 @@ describe('set initial data', () => {
7676
})
7777

7878
it('sets data using fixture', () => {
79-
cy.fixture('two-items').then(todos => {
79+
cy.fixture('two-items').then((todos) => {
8080
// "todos" is an array
8181
cy.task('resetData', { todos })
8282
})

cypress/integration/04-reset-state/spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Adds a todo item
44
* @param {string} text
55
*/
6-
const addItem = text => {
6+
const addItem = (text) => {
77
cy.get('.new-todo').type(`${text}{enter}`)
88
}
99

0 commit comments

Comments
 (0)