-
-
Notifications
You must be signed in to change notification settings - Fork 0
Setup e2e testing #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,19 @@ | ||
| import { defineConfig } from "cypress"; | ||
|
|
||
| export default defineConfig({ | ||
| e2e: { | ||
| setupNodeEvents(on, config) {}, | ||
| // Include shadow DOM elements in command results | ||
| includeShadowDom: true, | ||
| // Allow certain Content Security Policies | ||
| experimentalCspAllowList: true, | ||
| // Run all specs together | ||
| experimentalRunAllSpecs: true, | ||
| // Enable experimental Cypress Studio feature | ||
| experimentalStudio: true, | ||
| // Enable experimental interactive run events | ||
| experimentalInteractiveRunEvents: true, | ||
| // Enable experimental memory management | ||
| experimentalMemoryManagement: true, | ||
| }, | ||
| }); | ||
This file contains hidden or 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,30 @@ | ||
| describe("Landing Page", () => { | ||
| beforeEach(() => { | ||
| // Visit the landing page (adjust port if needed) | ||
| cy.visit("http://localhost:3000"); | ||
| }); | ||
|
|
||
| it("should render page", () => { | ||
| // Featured Articles section | ||
| cy.get("#featuredArticles").should("exist").and("be.visible"); | ||
| cy.get("#featuredArticles h2.title").should("contain", "Featured Articles"); | ||
|
|
||
| // Carousel and indicators | ||
| cy.get("#carouselExampleIndicators").should("exist"); | ||
| cy.get("#carouselInner").should("exist"); | ||
| cy.get("#carouselIndicator").should("exist"); | ||
|
|
||
| // Display Articles section should have content (not be empty) | ||
| cy.get("#displayArticles") | ||
| .should("exist") | ||
| .and(($el) => { | ||
| expect($el.text().trim().length).to.be.greaterThan(0); | ||
| }); | ||
|
|
||
| // SVG Title image | ||
| cy.get('img[src*="title.svg"]').should("exist").and("be.visible"); | ||
|
|
||
| // Article body exists (may be hidden initially) | ||
| cy.get("#articleBody").should("exist"); | ||
| }); | ||
| }); |
This file contains hidden or 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,27 @@ | ||
| /// <reference types="cypress" /> | ||
| // *********************************************** | ||
| // This example commands.ts shows you how to | ||
AlexJSully marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // create various custom commands and overwrite | ||
| // existing commands. | ||
| // | ||
| // For more comprehensive examples of custom | ||
| // commands please read more here: | ||
| // https://on.cypress.io/custom-commands | ||
| // *********************************************** | ||
| // | ||
| // | ||
| // -- This is a parent command -- | ||
| // Cypress.Commands.add('login', (email, password) => { ... }) | ||
| // | ||
| // | ||
| // -- This is a child command -- | ||
| // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) | ||
| // | ||
| // | ||
| // -- This is a dual command -- | ||
| // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
| // | ||
| // | ||
| // -- This will overwrite an existing command -- | ||
| // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | ||
| // | ||
This file contains hidden or 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,19 @@ | ||
| // *********************************************************** | ||
| // This example support/e2e.ts is processed and | ||
AlexJSully marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // loaded automatically before your test files. | ||
| // | ||
| // This is a great place to put global configuration and | ||
| // behavior that modifies Cypress. | ||
| // | ||
| // You can change the location of this file or turn off | ||
| // automatically serving support files with the | ||
| // 'supportFile' configuration option. | ||
| // | ||
| // You can read more here: | ||
| // https://on.cypress.io/configuration | ||
| // *********************************************************** | ||
| // Import commands.js using ES2015 syntax: | ||
| import "./commands"; | ||
|
|
||
| // Alternatively you can use CommonJS syntax: | ||
| // require('./commands') | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.