From d630365c72130fc247882ea02baf9ea31f522cec Mon Sep 17 00:00:00 2001
From: Robert Wagner
Date: Mon, 13 Aug 2018 19:42:49 -0400
Subject: [PATCH 1/8] Start on cypress
---
.gitignore | 2 +
cypress.json | 3 +
cypress/.eslintrc.js | 29 ++
cypress/integration/test.shepherd.js | 24 +
cypress/plugins/index.js | 17 +
cypress/support/commands.js | 25 ++
cypress/support/index.js | 20 +
docs/welcome/index.html | 16 +-
package.json | 15 +-
test/.eslintrc.js | 4 +-
yarn.lock | 643 +++++++++++++++++++++++++--
11 files changed, 751 insertions(+), 47 deletions(-)
create mode 100644 cypress.json
create mode 100644 cypress/.eslintrc.js
create mode 100644 cypress/integration/test.shepherd.js
create mode 100644 cypress/plugins/index.js
create mode 100644 cypress/support/commands.js
create mode 100644 cypress/support/index.js
diff --git a/.gitignore b/.gitignore
index 154d824ab..048a1f8a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,8 @@
/.log/
/.nyc_output/
/coverage/
+/cypress/**/examples/
+/cypress/videos/
/dist/
/node_modules/
/.DS_Store
diff --git a/cypress.json b/cypress.json
new file mode 100644
index 000000000..60ed5aa53
--- /dev/null
+++ b/cypress.json
@@ -0,0 +1,3 @@
+{
+ "video": false
+}
diff --git a/cypress/.eslintrc.js b/cypress/.eslintrc.js
new file mode 100644
index 000000000..acfb3294b
--- /dev/null
+++ b/cypress/.eslintrc.js
@@ -0,0 +1,29 @@
+module.exports = {
+ root: true,
+ parserOptions: {
+ ecmaVersion: 2017,
+ sourceType: 'module'
+ },
+ plugins: [
+ 'mocha'
+ ],
+ extends: [
+ 'eslint:recommended',
+ 'plugin:mocha/recommended'
+ ],
+ globals: {
+ cy: false,
+ document: false,
+ window: false,
+ assert: false,
+ Shepherd: false
+ },
+ env: {
+ browser: false,
+ mocha: true,
+ node: true
+ },
+ rules: {
+ 'no-console': 'off'
+ }
+};
diff --git a/cypress/integration/test.shepherd.js b/cypress/integration/test.shepherd.js
new file mode 100644
index 000000000..4d6bb0739
--- /dev/null
+++ b/cypress/integration/test.shepherd.js
@@ -0,0 +1,24 @@
+describe('Shepherd Acceptance Tests', () => {
+ beforeEach(() => {
+ cy.visit('http://localhost:8080/docs/welcome/');
+ })
+
+ it('next/previous buttons work', () => {
+ // Step one text should be visible
+ cy.get('.shepherd-text')
+ .contains('Shepherd is a javascript library').should('be.visible');
+ // Click next
+ cy.contains('Next').click();
+ // Step two text should be visible
+ cy.get('.shepherd-text')
+ .contains('Including Shepherd is easy!').should('be.visible');
+ // Step one text should be hidden
+ cy.get('.shepherd-text')
+ .contains('Shepherd is a javascript library').should('not.be.visible');
+ // Click back
+ cy.contains('Back').click();
+ // Step one text should be visible again
+ cy.get('.shepherd-text')
+ .contains('Shepherd is a javascript library').should('be.visible');
+ });
+});
\ No newline at end of file
diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js
new file mode 100644
index 000000000..fd170fba6
--- /dev/null
+++ b/cypress/plugins/index.js
@@ -0,0 +1,17 @@
+// ***********************************************************
+// This example plugins/index.js can be used to load plugins
+//
+// You can change the location of this file or turn off loading
+// the plugins file with the 'pluginsFile' configuration option.
+//
+// You can read more here:
+// https://on.cypress.io/plugins-guide
+// ***********************************************************
+
+// This function is called when a project is opened or re-opened (e.g. due to
+// the project's config changing)
+
+module.exports = (on, config) => {
+ // `on` is used to hook into various events Cypress emits
+ // `config` is the resolved Cypress config
+}
diff --git a/cypress/support/commands.js b/cypress/support/commands.js
new file mode 100644
index 000000000..c1f5a772e
--- /dev/null
+++ b/cypress/support/commands.js
@@ -0,0 +1,25 @@
+// ***********************************************
+// This example commands.js shows you how to
+// create various custom commands and overwrite
+// existing commands.
+//
+// For more comprehensive examples of custom
+// commands please read more here:
+// https://on.cypress.io/custom-commands
+// ***********************************************
+//
+//
+// -- This is a parent command --
+// Cypress.Commands.add("login", (email, password) => { ... })
+//
+//
+// -- This is a child command --
+// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
+//
+//
+// -- This is a dual command --
+// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
+//
+//
+// -- This is will overwrite an existing command --
+// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
diff --git a/cypress/support/index.js b/cypress/support/index.js
new file mode 100644
index 000000000..d68db96df
--- /dev/null
+++ b/cypress/support/index.js
@@ -0,0 +1,20 @@
+// ***********************************************************
+// This example support/index.js is processed and
+// loaded automatically before your test files.
+//
+// This is a great place to put global configuration and
+// behavior that modifies Cypress.
+//
+// You can change the location of this file or turn off
+// automatically serving support files with the
+// 'supportFile' configuration option.
+//
+// You can read more here:
+// https://on.cypress.io/configuration
+// ***********************************************************
+
+// Import commands.js using ES2015 syntax:
+import './commands'
+
+// Alternatively you can use CommonJS syntax:
+// require('./commands')
diff --git a/docs/welcome/index.html b/docs/welcome/index.html
index 5f6bd4a4a..764c45fdb 100644
--- a/docs/welcome/index.html
+++ b/docs/welcome/index.html
@@ -8,11 +8,11 @@
-
+
-
-
+
+
@@ -66,18 +66,18 @@ Example
-
+
-
-
+
+
-
-
+
+