-
Notifications
You must be signed in to change notification settings - Fork 42
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
Showing
9 changed files
with
1,396 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
name: maas.io e2e test failed | ||
about: '' | ||
title: 'maas.io/docs links test failed on {{ env.BRANCH_NAME }}' | ||
assignees: '' | ||
|
||
--- | ||
|
||
[maas.io e2e test failed](<https://github.com/{{> env.REPO }}/actions/runs/{{ env.RUN_ID }}) on the {{ env.BRANCH_NAME }} branch. |
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,28 @@ | ||
name: API Docs | ||
on: | ||
schedule: | ||
- cron: "0 10 * * 1-5" # At 10:00 every day-of-week from Monday through Friday. | ||
jobs: | ||
api-docs: | ||
name: maas.io/docs/api | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Get branch name | ||
uses: nelonoel/[email protected] | ||
- name: Run Cypress docs tests | ||
uses: cypress-io/github-action@v4 | ||
with: | ||
browser: chrome | ||
config: baseUrl=http://maas.io/ | ||
spec: "cypress/e2e/**/*.{js,jsx,ts,tsx}" | ||
- name: Create issue on failure | ||
if: failure() | ||
uses: JasonEtco/create-an-issue@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REPO: ${{ github.repository }} | ||
RUN_ID: ${{ github.run_id }} | ||
with: | ||
filename: .github/CYPRESS_ISSUE_TEMPLATE.md | ||
update_existing: true |
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 @@ | ||
const { defineConfig } = require("cypress"); | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
baseUrl: "https://maas.io/", | ||
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}", | ||
}, | ||
}); |
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,22 @@ | ||
|
||
context("/docs/api", () => { | ||
beforeEach(() => { | ||
cy.setCookie("_cookies_accepted", "all"); | ||
cy.visit("/docs/api"); | ||
}); | ||
|
||
it("displays side navigation correctly", () => { | ||
cy.get(".p-side-navigation__drawer").should("not.be.visible"); | ||
cy.findByRole("link", { name: /Toggle side navigation/ }).click(); | ||
cy.get(".p-side-navigation__drawer").should("be.visible"); | ||
cy.get(".p-side-navigation__drawer") | ||
.findAllByRole("link") | ||
.should("have.length.least", 1); | ||
}); | ||
|
||
it("displays content correctly", () => { | ||
cy.visit("/docs/api"); | ||
cy.findByRole("heading", { level: 1, name: "MAAS API" }).should("exist"); | ||
cy.findByRole("heading", { level: 2, name: "Operations" }).should("exist"); | ||
}); | ||
}); |
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 @@ | ||
import "@testing-library/cypress/add-commands"; |
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
Oops, something went wrong.