mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 13:38:18 -08:00
Get past basic authorization
This commit is contained in:
parent
e65ec4d961
commit
30f0c8f2d9
27 changed files with 70 additions and 8 deletions
1
.env
Normal file
1
.env
Normal file
|
|
@ -0,0 +1 @@
|
|||
CYPRESS_RAILS_PORT=5678
|
||||
13
config/initializers/cypress_rails.rb
Normal file
13
config/initializers/cypress_rails.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
return unless Rails.env.test?
|
||||
|
||||
Rails.application.load_tasks unless defined?(Rake::Task)
|
||||
CypressRails.hooks.before_server_start do
|
||||
Rake::Task["db:seed"].invoke
|
||||
end
|
||||
CypressRails.hooks.after_transaction_start do
|
||||
end
|
||||
CypressRails.hooks.after_state_reset do
|
||||
end
|
||||
CypressRails.hooks.before_server_stop do
|
||||
Rake::Task["db:test:prepare"].invoke
|
||||
end
|
||||
|
|
@ -9,7 +9,7 @@ module.exports = defineConfig({
|
|||
/* ... */
|
||||
})
|
||||
},
|
||||
supportFile: false
|
||||
supportFile: false,
|
||||
},
|
||||
screenshotsFolder: "tmp/cypress_screenshots",
|
||||
videosFolder: "tmp/cypress_videos",
|
||||
|
|
|
|||
43
cypress/e2e/journey.cy.js
Normal file
43
cypress/e2e/journey.cy.js
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
// Welcome to Cypress!
|
||||
//
|
||||
// This spec file contains a variety of sample tests
|
||||
// for a todo list app that are designed to demonstrate
|
||||
// the power of writing tests in Cypress.
|
||||
//
|
||||
// To learn more about how Cypress works and
|
||||
// what makes it such an awesome testing tool,
|
||||
// please read our getting started guide:
|
||||
// https://on.cypress.io/introduction-to-cypress
|
||||
|
||||
describe('example to-do app', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/')
|
||||
})
|
||||
|
||||
it('displays the div containing the framework wheel', () => {
|
||||
cy.get('.framework-wheel-container').should('have.length', 1)
|
||||
})
|
||||
|
||||
it('displays the title of the teachers and leadership accordion', () => {
|
||||
cy.get('[data-bs-target="#teachers-and-leadership-item"]').should('include.text', "Teachers & Leadership")
|
||||
})
|
||||
|
||||
it('shows schools when a district is selected', () => {
|
||||
cy.get("#district-dropdown").select('Lee Public Schools')
|
||||
cy.get("#school-dropdown").select('Lee Elementary School')
|
||||
cy.get("#school-dropdown").children("option[selected='selected']").should('have.text', 'Lee Elementary School')
|
||||
|
||||
cy.contains('Go').click()
|
||||
|
||||
cy.visit("districts/lee-public-schools/schools/lee-elementary-school/overview?year=2022-23", {
|
||||
headers: {
|
||||
authorization: 'Basic bGVlOmxlZSE='
|
||||
},
|
||||
failOnStatusCode: false
|
||||
})
|
||||
|
||||
cy.url().should('include', '/districts/lee-public-schools/schools/lee-elementary-school/overview?year=2022-23')
|
||||
})
|
||||
})
|
||||
|
|
@ -17,7 +17,8 @@ describe('example to-do app', () => {
|
|||
// so we must tell it to visit our website with the `cy.visit()` command.
|
||||
// Since we want to visit the same URL at the start of all our tests,
|
||||
// we include it in our beforeEach function so that it runs before each test
|
||||
cy.visit('https://example.cypress.io/todo')
|
||||
// cy.visit('https://example.cypress.io/todo')
|
||||
cy.visit(`${Cypress.env('host')}`)
|
||||
})
|
||||
|
||||
it('displays two todo items by default', () => {
|
||||
|
|
@ -31,6 +31,8 @@
|
|||
"watch:all": "yarn watch:css & yarn build --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cypress": "^12.17.1",
|
||||
"eslint-plugin-cypress": "^2.13.3",
|
||||
"jest": "^29.6.1",
|
||||
"jest-environment-jsdom": "^29.6.1",
|
||||
"markdownlint": "^0.29.0",
|
||||
|
|
|
|||
14
yarn.lock
14
yarn.lock
|
|
@ -2209,11 +2209,6 @@ cssstyle@^2.3.0:
|
|||
dependencies:
|
||||
cssom "~0.3.6"
|
||||
|
||||
cypress-esbuild-preprocessor@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/cypress-esbuild-preprocessor/-/cypress-esbuild-preprocessor-1.0.2.tgz#84b8483c8dd7f48ccc69d4742860746d21a42dea"
|
||||
integrity sha512-JsFnm6fBQt/OEzstknJ1KLMTuUERUaG0ZB9fk0KdNUlZqxaVEoQ9/pFvKmqRfzUe2y00cWD++ptccQA4tNAAlQ==
|
||||
|
||||
cypress@^12.17.1:
|
||||
version "12.17.1"
|
||||
resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.1.tgz#777fdcceec4ecd642fc90795f5994853b6ea03f8"
|
||||
|
|
@ -2447,6 +2442,13 @@ escodegen@^2.0.0:
|
|||
optionalDependencies:
|
||||
source-map "~0.6.1"
|
||||
|
||||
eslint-plugin-cypress@^2.13.3:
|
||||
version "2.13.3"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.13.3.tgz#5fc1afdc939aaa7daa9181f651f2f35429733ff2"
|
||||
integrity sha512-nAPjZE5WopCsgJwl3vHm5iafpV+ZRO76Z9hMyRygWhmg5ODXDPd+9MaPl7kdJ2azj+sO87H3P1PRnggIrz848g==
|
||||
dependencies:
|
||||
globals "^11.12.0"
|
||||
|
||||
esprima@^4.0.0, esprima@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
|
||||
|
|
@ -2713,7 +2715,7 @@ global-dirs@^3.0.0:
|
|||
dependencies:
|
||||
ini "2.0.0"
|
||||
|
||||
globals@^11.1.0:
|
||||
globals@^11.1.0, globals@^11.12.0:
|
||||
version "11.12.0"
|
||||
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
|
||||
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue