mirror of https://github.com/sgoudham/carbon.git
Introducing Applitools (#762)
* Applitools (#1) * Adding applitools * adding data attributes for testing * add applitools keymain
parent
14440e7a0f
commit
75493ee557
@ -0,0 +1,48 @@
|
||||
/* global cy,before,after */
|
||||
import { environment } from '../../util'
|
||||
describe('Visual Regression Testing', () => {
|
||||
before(() => {
|
||||
cy.eyesOpen({
|
||||
appName: 'Carbon',
|
||||
testName: 'Button',
|
||||
browser: environment
|
||||
})
|
||||
cy.visit('/')
|
||||
})
|
||||
after(() => {
|
||||
cy.eyesClose()
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.reload()
|
||||
})
|
||||
|
||||
it('test export button', () => {
|
||||
cy.get('[data-cy=export-button]').click()
|
||||
cy.eyesCheckWindow({
|
||||
tag: 'export button',
|
||||
sizeMode: 'selector', //mode
|
||||
selector: '.page'
|
||||
})
|
||||
})
|
||||
|
||||
it('test display button', () => {
|
||||
cy.get('[data-cy=display]').click()
|
||||
cy.eyesCheckWindow({
|
||||
tag: 'display button',
|
||||
sizeMode: 'selector', //mode
|
||||
selector: '.page'
|
||||
})
|
||||
})
|
||||
|
||||
it('test color button', () => {
|
||||
cy.get('[data-cy=display]').click()
|
||||
cy.wait(2000)
|
||||
cy.get('[title="#50E3C2"]').click()
|
||||
cy.wait(500)
|
||||
cy.eyesCheckWindow({
|
||||
tag: 'color button',
|
||||
sizeMode: 'selector', //mode
|
||||
selector: '.page'
|
||||
})
|
||||
})
|
||||
})
|
@ -0,0 +1,40 @@
|
||||
/* global cy,before,after */
|
||||
import { environment } from '../../util'
|
||||
describe('Visual Regression Testing', () => {
|
||||
before(() => {
|
||||
cy.eyesOpen({
|
||||
appName: 'Carbon',
|
||||
testName: 'Syntax',
|
||||
browser: environment
|
||||
})
|
||||
})
|
||||
after(() => {
|
||||
cy.eyesClose()
|
||||
})
|
||||
|
||||
it('syntax test for JSON', () => {
|
||||
cy.visit("/?code={name:'Andrew',age:30}&l=application%2Fjson")
|
||||
cy.eyesCheckWindow({
|
||||
tag: 'JSON',
|
||||
sizeMode: 'selector', //mode
|
||||
selector: '.page'
|
||||
})
|
||||
})
|
||||
|
||||
it('syntax test for C#', () => {
|
||||
cy.visit('/?code=class Program { static void Main(){ do }}&l=text%2Fx-csharp')
|
||||
cy.eyesCheckWindow({
|
||||
tag: 'C#',
|
||||
sizeMode: 'selector', //mode
|
||||
selector: '.page'
|
||||
})
|
||||
})
|
||||
it('syntax test for C++', () => {
|
||||
cy.visit('/?l=text%2Fx-c%2B%2Bsrc&code=for(size_t i=0 ;i<length; i%2B%2B){}')
|
||||
cy.eyesCheckWindow({
|
||||
tag: 'C++',
|
||||
sizeMode: 'selector', //mode
|
||||
selector: '.page'
|
||||
})
|
||||
})
|
||||
})
|
@ -0,0 +1,28 @@
|
||||
/* global cy,before,after */
|
||||
import { environment } from '../../util'
|
||||
describe('Visual Regression Testing', () => {
|
||||
before(() => {
|
||||
cy.eyesOpen({
|
||||
appName: 'Carbon',
|
||||
testName: 'Themes',
|
||||
browser: environment
|
||||
})
|
||||
cy.visit('/')
|
||||
})
|
||||
after(() => {
|
||||
cy.eyesClose()
|
||||
})
|
||||
|
||||
it('themes test', () => {
|
||||
for (let childIndex = 1; childIndex < 28; childIndex++) {
|
||||
cy.get('[data-cy="themes-container"] [data-cy="theme-selector-button"]').click()
|
||||
cy.get(
|
||||
`[data-cy="themes-container"] [data-cy="dropdown-item"]:nth-child(${childIndex + 1})`
|
||||
).click({ force: true })
|
||||
cy.eyesCheckWindow({
|
||||
sizeMode: 'selector', //mode
|
||||
selector: '.page'
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
@ -0,0 +1 @@
|
||||
export const environment = { width: 1000, height: 768, name: 'chrome' }
|
Loading…
Reference in New Issue