-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
10 changed files
with
1,120 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,6 @@ package/*.scss | |
package/*.svelte | ||
!package/postinstall.js | ||
dist/demo | ||
|
||
|
||
cypress/screenshots |
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,3 @@ | ||
{ | ||
"video": false | ||
} |
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,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
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,59 @@ | ||
/// <reference types="cypress" /> | ||
|
||
context('Core', () => { | ||
beforeEach(() => { | ||
cy.visit('../../../playground/core/'); | ||
}); | ||
|
||
describe('Init', () => { | ||
it('Active class', () => { | ||
cy.get('.swiper-container').contains('Slide 3').should('have.class', 'swiper-slide-active'); | ||
}); | ||
|
||
it('Prev class', () => { | ||
cy.get('.swiper-container').contains('Slide 2').should('have.class', 'swiper-slide-prev'); | ||
}); | ||
|
||
it('Next class', () => { | ||
cy.get('.swiper-container').contains('Slide 4').should('have.class', 'swiper-slide-next'); | ||
}); | ||
|
||
it('a11y', () => { | ||
cy.get('.swiper-container') | ||
.find('.swiper-slide') | ||
.should('have.attr', 'aria-role-description', 'slide'); | ||
cy.get('.swiper-container').find('.swiper-slide').should('have.attr', 'role', 'group'); | ||
// cy.get('.swiper-container').find('.swiper-slide').should('have.attr', 'aria-lalbel'); | ||
}); | ||
}); | ||
|
||
describe('Slide', () => { | ||
it('Should slide next on slide click', () => { | ||
cy.get('.swiper-slide-next').click(); | ||
cy.get('.swiper-container').contains('Slide 3').should('have.class', 'swiper-slide-prev'); | ||
cy.get('.swiper-container').contains('Slide 4').should('have.class', 'swiper-slide-active'); | ||
cy.get('.swiper-container').contains('Slide 5').should('have.class', 'swiper-slide-next'); | ||
}); | ||
|
||
it('Should slide prev on slide click', () => { | ||
cy.get('.swiper-slide-prev').click(); | ||
cy.get('.swiper-container').contains('Slide 1').should('have.class', 'swiper-slide-prev'); | ||
cy.get('.swiper-container').contains('Slide 2').should('have.class', 'swiper-slide-active'); | ||
cy.get('.swiper-container').contains('Slide 3').should('have.class', 'swiper-slide-next'); | ||
}); | ||
|
||
it('Should slide next', () => { | ||
cy.get('.swiper-button-next').click(); | ||
cy.get('.swiper-container').contains('Slide 3').should('have.class', 'swiper-slide-prev'); | ||
cy.get('.swiper-container').contains('Slide 4').should('have.class', 'swiper-slide-active'); | ||
cy.get('.swiper-container').contains('Slide 5').should('have.class', 'swiper-slide-next'); | ||
}); | ||
|
||
it('Should slide prev', () => { | ||
cy.get('.swiper-button-prev').click(); | ||
cy.get('.swiper-container').contains('Slide 1').should('have.class', 'swiper-slide-prev'); | ||
cy.get('.swiper-container').contains('Slide 2').should('have.class', 'swiper-slide-active'); | ||
cy.get('.swiper-container').contains('Slide 3').should('have.class', 'swiper-slide-next'); | ||
}); | ||
}); | ||
}); |
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 @@ | ||
/// <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} | ||
*/ | ||
/* eslint-disable no-unused-vars */ | ||
module.exports = (on, config) => { | ||
// `on` is used to hook into various events Cypress emits | ||
// `config` is the resolved Cypress config | ||
}; |
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,25 @@ | ||
// *********************************************** | ||
// This example commands.js shows you how to | ||
// 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 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,20 @@ | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// 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') |
Oops, something went wrong.