Skip to content

Commit

Permalink
Fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSurgisonGDS committed Jul 22, 2022
1 parent 7bcb4b1 commit 1282edb
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { deleteFile } from '../utils'

const { waitForApplication, copyFile } = require('../utils')

const testDir = path.resolve(process.env.KIT_TEST_DIR || 'cypress/temp/test-project')

const fixtures = path.join(Cypress.config('fixturesFolder'))

const fixtureViews = path.join(fixtures, 'views')
Expand All @@ -29,20 +31,24 @@ const assertHidden = (step) => {
cy.get(showHideLinkQuery(step)).should('contains.text', 'Show')
}

const runScript = (script) => {
script = `cd ${testDir} && ${script}`
cy.task('log', script)
cy.exec(script)
}

describe('Step by step journey', async () => {
beforeEach(() => {
cy.exec('npm install jquery')
cy.wait(2000)
before(() => {
runScript('npm install jquery')
waitForApplication()
copyFile(stepByStepNavigationFixtureView, stepByStepNavigationView)
cy.visit(stepByStepNavigationPath)
cy.get('h1').should('contains.text', 'Juggling Tricks: step by step')
})

afterEach(() => {
after(() => {
deleteFile(stepByStepNavigationView)
cy.exec('npm uninstall jquery')
cy.wait(2000)
runScript('npm uninstall jquery')
})

it('renders ok', () => {
Expand Down

0 comments on commit 1282edb

Please sign in to comment.