-
Notifications
You must be signed in to change notification settings - Fork 970
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: Add next step | Improve test-tutorial * Shuffle e2e test folder layout | Add cli tests * Merge to main * Add some fixes for new run-e2e * PR comments * run-e2e: Always makeDirectory
- Loading branch information
Showing
25 changed files
with
88 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
"runMode": 2, | ||
"openMode": 0 | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
61 changes: 61 additions & 0 deletions
61
tasks/e2e/cypress/integration/02-cli/02-cli-commands.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* eslint-disable no-undef, camelcase */ | ||
/// <reference types="cypress" /> | ||
|
||
const BASE_DIR = Cypress.env('RW_PATH') | ||
|
||
describe('Check Redwood cli commands against tutorial', () => { | ||
// These tests aren't visual, as they only run on the CLI | ||
// Disable taking screenshots/videos for this spec | ||
before(() => { | ||
Cypress.config('record', false) | ||
}) | ||
|
||
after(() => { | ||
Cypress.config('record', true) | ||
}) | ||
it('Should run api tests successfully', () => { | ||
cy.exec(`cd ${BASE_DIR}; yarn rw test api --no-watch`, { | ||
timeout: 60000, | ||
}) | ||
.its('code') | ||
.should('eq', 0) | ||
}) | ||
|
||
// @TODO figure out why babel issues happen when linked | ||
it.skip('Should run web tests successfully', () => { | ||
cy.exec(`cd ${BASE_DIR}; yarn rw test web --no-watch`, { | ||
timeout: 60000, | ||
}) | ||
.its('code') | ||
.should('eq', 0) | ||
}) | ||
|
||
it('Should run build successfully (no prerender)', () => { | ||
// Check if webpack build on web, and babel build on api | ||
// work correctly | ||
cy.exec(`cd ${BASE_DIR}; yarn rw build --no-prerender`, { | ||
timeout: 60000, | ||
}) | ||
.its('code') | ||
.should('eq', 0) | ||
}) | ||
|
||
it('Should prerender about and homepage', () => { | ||
// Check if prerender is working | ||
cy.exec(`cd ${BASE_DIR}; yarn rw prerender`, { | ||
timeout: 60000, | ||
}) | ||
.its('code') | ||
.should('eq', 0) | ||
|
||
const WEB_DIST = `${BASE_DIR}/web/dist` | ||
|
||
// Check prerendered files are generated | ||
// Prerender prop added to routes in codemods/Step6_1_Routes.js | ||
cy.readFile(`${WEB_DIST}/index.html`).should('contain', 'Redwood Blog') | ||
cy.readFile(`${WEB_DIST}/about.html`).should( | ||
'contain', | ||
'This site was created to demonstrate my mastery of Redwood' | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters