-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add visual tests * more env setting
- Loading branch information
1 parent
1fbeed9
commit 26cab91
Showing
12 changed files
with
1,612 additions
and
109 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
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 @@ | ||
{ | ||
"baseUrl": "http://localhost:3000", | ||
"testFiles": "**/*.visual.js", | ||
"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,13 @@ | ||
{ | ||
"plugins": ["cypress"], | ||
"rules": { | ||
"cypress/no-assigning-return-values": "error", | ||
"cypress/no-unnecessary-waiting": "error", | ||
"cypress/assertion-before-screenshot": "warn", | ||
"cypress/no-force": "warn", | ||
"cypress/no-async-tests": "error" | ||
}, | ||
"env": { | ||
"cypress/globals": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe('Popup: visual', () => { | ||
it('inside a Modal', () => { | ||
cy.visit('/maximize/popup-visual-inside-modal/') | ||
|
||
cy.get('[data-tid="button-dialog"]').click() | ||
cy.get('[data-tid="button-popup"]').click() | ||
cy.get('[data-tid="popup-content"]').should('be.visible') | ||
|
||
cy.percySnapshot('Popup: inside a Modal') | ||
}) | ||
|
||
it('floating Button', () => { | ||
cy.visit('/maximize/popup-visual-floating-button/') | ||
|
||
cy.get('[data-tid="button-popup"]').click() | ||
cy.get('[data-tid="popup-content"]').should('be.visible') | ||
|
||
cy.percySnapshot('Popup: floating Button') | ||
}) | ||
}) |
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 @@ | ||
const percyHealthCheck = require('@percy/cypress/task') | ||
|
||
module.exports = (on) => { | ||
on('task', percyHealthCheck) | ||
} |
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 '@percy/cypress' |
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 './commands' |
14 changes: 14 additions & 0 deletions
14
docs/src/examples/modules/Popup/Visual/PopupVisualFloatingButton.js
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,14 @@ | ||
import React from 'react' | ||
import { Button, Popup } from 'semantic-ui-react' | ||
|
||
const PopupVisualFloatingButton = () => ( | ||
<Popup | ||
data-tid='popup-content' | ||
on='click' | ||
trigger={<Button data-tid='button-popup'>Open a popup</Button>} | ||
> | ||
<Button floated='right'>I am a floating button</Button> | ||
</Popup> | ||
) | ||
|
||
export default PopupVisualFloatingButton |
18 changes: 18 additions & 0 deletions
18
docs/src/examples/modules/Popup/Visual/PopupVisualInsideModal.js
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,18 @@ | ||
import React from 'react' | ||
import { Button, Modal, Popup } from 'semantic-ui-react' | ||
|
||
const PopupVisualInsideModal = () => ( | ||
<Modal trigger={<Button data-tid='button-dialog'>Open a dialog</Button>}> | ||
<p>This is a dialog</p> | ||
|
||
<Popup | ||
data-tid='popup-content' | ||
on='click' | ||
trigger={<Button data-tid='button-popup'>Open a popup</Button>} | ||
> | ||
This is a nested Popup | ||
</Popup> | ||
</Modal> | ||
) | ||
|
||
export default PopupVisualInsideModal |
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.