Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
chore: cypress migration
Browse files Browse the repository at this point in the history
  • Loading branch information
outloudvi committed Oct 15, 2022
1 parent 47f1ee6 commit b181140
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 105 deletions.
138 changes: 136 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,139 @@
/node_modules/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Cypress
/cypress/screenshots
/cypress/videos

/public/build/
/dist

.DS_Store
.DS_Store
9 changes: 9 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { defineConfig } = require('cypress')

module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:8080',
experimentalFetchPolyfill: true,
supportFile: false,
},
})
5 changes: 0 additions & 5 deletions cypress.json

This file was deleted.

20 changes: 5 additions & 15 deletions cypress/integration/spec.ts → cypress/e2e/spec.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Language switch', () => {
it('works for en', () => {
cy.visit('/?lang=en&testing=1')
cy.visit('/?lang=en')
cy.title().should('include', 'Starbuttons')
})

Expand Down Expand Up @@ -46,27 +46,17 @@ describe('Board stuffs', () => {
]

before(() => {
cy.server()
cy.route('GET', '/sounds.json', 'fixture:sounds.json').as('getSounds')
cy.route('GET', '/categories.json', 'fixture:categories.json').as(
'getCategories'
)
cy.visit('/?lang=en&testing=1')
cy.get('#switchBtn').click()
cy.visit('/?lang=en')
})

it('has the center button', () => {
cy.get('#bigBtn div').contains('Eeehihihihi')
})

it('have stuffs in board', () => {
cy.get('#boardContext h2').should('have.length', 3)
cy.get('#boardContext .baseBtn').should('have.length', 3)
let here = cy.get('#boardContext h2:first')
for (let i = 0; i < 6; i++) {
if (i !== 0) here = here.next()
here.should('have.text', pages[i])
}
cy.get('#switchBtn').click()
cy.get('#boardContext h2').should('have.length', 14)
cy.get('#boardContext .baseBtn').should('have.length.greaterThan', 120)
})
})

Expand Down
15 changes: 0 additions & 15 deletions cypress/fixtures/categories.json

This file was deleted.

46 changes: 0 additions & 46 deletions cypress/fixtures/sounds.json

This file was deleted.

21 changes: 0 additions & 21 deletions cypress/plugins/index.js

This file was deleted.

4 changes: 3 additions & 1 deletion cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress"]
"types": ["cypress"],
"strict": true,
"forceConsistentCasingInFileNames": true
},
"include": ["**/*.ts"]
}

0 comments on commit b181140

Please sign in to comment.