-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d740bfe
commit 22bb44c
Showing
16 changed files
with
1,054 additions
and
55 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
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
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,8 @@ | ||
import { defineConfig } from 'cypress' | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
baseUrl: 'http://localhost:1234', | ||
testIsolation: false | ||
}, | ||
}) |
97 changes: 97 additions & 0 deletions
97
packages/website/cypress/e2e/course-list/course-list.cy.ts
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,97 @@ | ||
/// <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(() => { | ||
// Cypress starts out with a blank slate for each test | ||
// 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('http://localhost:8000').waitForRouteChange(); | ||
}); | ||
|
||
it('displays multiple courses', () => { | ||
// We use the `cy.get()` command to get all elements that match the selector. | ||
// Then, we use `should` to assert that there are two matched items, | ||
// which are the two default items. | ||
cy.get('.course-summary').should('have.length', 4); | ||
|
||
// We can go even further and check that the default todos each contain | ||
// the correct text. We use the `first` and `last` functions | ||
// to get just the first and last matched elements individually, | ||
// and then perform an assertion with `should`. | ||
// cy.get('.todo-list li').first().should('have.text', 'Pay electric bill') | ||
// cy.get('.todo-list li').last().should('have.text', 'Walk the dog') | ||
}); | ||
|
||
it('clicking TS-fundamentals v3 course link visits the course page', () => { | ||
cy.contains('TypeScript Fundamentals v3').click(); | ||
cy.location('href').should( | ||
'include', | ||
'course/fundamentals-v3', | ||
); | ||
cy.get('h1').should( | ||
'have.text', | ||
'TypeScript Fundamentals v3', | ||
); | ||
cy.get('.course-article__title').should( | ||
'have.length.at.least', | ||
5, | ||
); | ||
}); | ||
it('clicking TS-intermediate v1 course link visits the course page', () => { | ||
cy.contains('Intermediate TypeScript').click(); | ||
cy.location('href').should( | ||
'include', | ||
'course/intermediate-v1', | ||
); | ||
cy.get('h1').should( | ||
'have.text', | ||
'Intermediate TypeScript', | ||
); | ||
cy.get('.course-article__title').should( | ||
'have.length.at.least', | ||
5, | ||
); | ||
}); | ||
it('clicking TS-fullstack v1 course link visits the course page', () => { | ||
cy.contains('Full Stack TypeScript').click(); | ||
cy.location('href').should( | ||
'include', | ||
'course/full-stack-typescript', | ||
); | ||
cy.get('h1').should( | ||
'have.text', | ||
'Full Stack TypeScript', | ||
); | ||
cy.get('.course-article__title').should( | ||
'have.length.at.least', | ||
5, | ||
); | ||
}); | ||
it('clicking make-TS-stick v1 course link visits the course page', () => { | ||
cy.contains('Making TypeScript Stick').click(); | ||
cy.location('href').should( | ||
'include', | ||
'course/making-typescript-stick', | ||
); | ||
cy.get('h1').should( | ||
'have.text', | ||
'Making TypeScript Stick', | ||
); | ||
cy.get('.course-article__title').should( | ||
'have.length.at.least', | ||
5, | ||
); | ||
}); | ||
}); |
42 changes: 42 additions & 0 deletions
42
packages/website/cypress/e2e/courses/enterprise-typescript-v2.cy.ts
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,42 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe('course page', () => { | ||
beforeEach(() => { | ||
cy.visit( | ||
'http://localhost:8000/course/enterprise-v2', | ||
).waitForRouteChange(); | ||
}); | ||
|
||
it('course sections appear', () => { | ||
cy.get('.course-article__title').should( | ||
'have.length.above', | ||
4, | ||
); | ||
}); | ||
|
||
it('title is present', () => { | ||
cy.get('h1').should( | ||
'contain.text', | ||
'Enterprise TypeScript v2', | ||
); | ||
}); | ||
it('summary is present', () => { | ||
cy.contains('Combine TypeScript').should('exist'); | ||
}); | ||
it('logo is present', () => { | ||
cy.get('main > header > img') | ||
.should('exist') | ||
.should('have.attr', 'src', '/full-stack-ts.png'); | ||
}); | ||
it('clicking on a section works', () => { | ||
cy.get('.course-article__title') | ||
.contains('Intro') | ||
.click(); | ||
cy.waitForRouteChange(); | ||
cy.location('href').should( | ||
'include', | ||
'course/enterprise-v2/01', | ||
); | ||
cy.get('h2').should('have.length.above', 1); | ||
}); | ||
}); |
42 changes: 42 additions & 0 deletions
42
packages/website/cypress/e2e/courses/full-stack-typescript.cy.ts
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,42 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe('course page', () => { | ||
beforeEach(() => { | ||
cy.visit( | ||
'http://localhost:8000/course/full-stack-typescript', | ||
).waitForRouteChange(); | ||
}); | ||
|
||
it('course sections appear', () => { | ||
cy.get('.course-article__title').should( | ||
'have.length.above', | ||
4, | ||
); | ||
}); | ||
|
||
it('title is present', () => { | ||
cy.get('h1').should( | ||
'contain.text', | ||
'Full Stack TypeScript', | ||
); | ||
}); | ||
it('summary is present', () => { | ||
cy.contains('Combine TypeScript').should('exist'); | ||
}); | ||
it('logo is present', () => { | ||
cy.get('main > header > img') | ||
.should('exist') | ||
.should('have.attr', 'src', '/full-stack-ts.png'); | ||
}); | ||
it('clicking on a section works', () => { | ||
cy.get('.course-article__title') | ||
.contains('Intro') | ||
.click(); | ||
cy.waitForRouteChange(); | ||
cy.location('href').should( | ||
'include', | ||
'course/full-stack-typescript/01', | ||
); | ||
cy.get('h2').should('have.length.above', 1); | ||
}); | ||
}); |
42 changes: 42 additions & 0 deletions
42
packages/website/cypress/e2e/courses/fundamentals-v3.cy.ts
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,42 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe('course page', () => { | ||
beforeEach(() => { | ||
cy.visit( | ||
'http://localhost:8000/course/fundamentals-v3', | ||
).waitForRouteChange(); | ||
}); | ||
|
||
it('course sections appear', () => { | ||
cy.get('.course-article__title').should( | ||
'have.length.above', | ||
4, | ||
); | ||
}); | ||
|
||
it('title is present', () => { | ||
cy.get('h1').should( | ||
'contain.text', | ||
'TypeScript Fundamentals', | ||
); | ||
}); | ||
it('summary is present', () => { | ||
cy.contains('Learn everything').should('exist'); | ||
}); | ||
it('logo is present', () => { | ||
cy.get('main > header > img') | ||
.should('exist') | ||
.should('have.attr', 'src', '/ts-fundamentals-v3.png'); | ||
}); | ||
it('clicking on a section works', () => { | ||
cy.get('.course-article__title') | ||
.contains('Intro') | ||
.click(); | ||
cy.waitForRouteChange(); | ||
cy.location('href').should( | ||
'include', | ||
'course/fundamentals-v3/01', | ||
); | ||
cy.get('h2').should('have.length.above', 4); | ||
}); | ||
}); |
42 changes: 42 additions & 0 deletions
42
packages/website/cypress/e2e/courses/fundamentals-v4.cy.ts
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,42 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe('course page', () => { | ||
beforeEach(() => { | ||
cy.visit( | ||
'http://localhost:8000/course/fundamentals-v4', | ||
).waitForRouteChange(); | ||
}); | ||
|
||
it('course sections appear', () => { | ||
cy.get('.course-article__title').should( | ||
'have.length.above', | ||
4, | ||
); | ||
}); | ||
|
||
it('title is present', () => { | ||
cy.get('h1').should( | ||
'contain.text', | ||
'TypeScript Fundamentals', | ||
); | ||
}); | ||
it('summary is present', () => { | ||
cy.contains('Learn everything').should('exist'); | ||
}); | ||
it('logo is present', () => { | ||
cy.get('main > header > img') | ||
.should('exist') | ||
.should('have.attr', 'src', '/ts-fundamentals-v3.png'); | ||
}); | ||
it('clicking on a section works', () => { | ||
cy.get('.course-article__title') | ||
.contains('Intro') | ||
.click(); | ||
cy.waitForRouteChange(); | ||
cy.location('href').should( | ||
'include', | ||
'course/fundamentals-v4/01', | ||
); | ||
cy.get('h2').should('have.length.above', 4); | ||
}); | ||
}); |
Oops, something went wrong.