mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
docs: use sapper/cypress for e2e testing
This commit is contained in:
parent
0bb5e1952f
commit
ccdf6af78d
36 changed files with 4373 additions and 26 deletions
11
docs/cypress/integration/Button.js
Normal file
11
docs/cypress/integration/Button.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
describe("Button", () => {
|
||||
beforeEach(() => {
|
||||
cy.examples("Button");
|
||||
});
|
||||
|
||||
it("renders correctly", () => {
|
||||
cy.get("button").then(($) => {
|
||||
expect($.length).to.eql(4);
|
||||
});
|
||||
});
|
||||
});
|
21
docs/cypress/plugins/index.js
Normal file
21
docs/cypress/plugins/index.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
/// <reference types="cypress" />
|
||||
// ***********************************************************
|
||||
// This example plugins/index.js can be used to load plugins
|
||||
//
|
||||
// You can change the location of this file or turn off loading
|
||||
// the plugins file with the 'pluginsFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/plugins-guide
|
||||
// ***********************************************************
|
||||
|
||||
// This function is called when a project is opened or re-opened (e.g. due to
|
||||
// the project's config changing)
|
||||
|
||||
/**
|
||||
* @type {Cypress.PluginConfig}
|
||||
*/
|
||||
module.exports = (on, config) => {
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
}
|
3
docs/cypress/support/commands.js
Normal file
3
docs/cypress/support/commands.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
Cypress.Commands.add("examples", (component) => {
|
||||
cy.visit(`/examples/${component}`);
|
||||
});
|
1
docs/cypress/support/index.js
Normal file
1
docs/cypress/support/index.js
Normal file
|
@ -0,0 +1 @@
|
|||
import "./commands";
|
Loading…
Add table
Add a link
Reference in a new issue