generated from poly-glot/vanilla-front-end-starter
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(integration-testing): Integration Testing | 009 - Added integrat…
…ion testing
- Loading branch information
Showing
2 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,8 +1,58 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe('Application', () => { | ||
const messages = { | ||
READY: 'Application is ready to use', | ||
PROCESS_STARTED: 'Processing your image.', | ||
PROCESS_FINISHED: 'Image has been processed.' | ||
} | ||
|
||
describe('BackgroundRemove Application', () => { | ||
it('As a User I should be able to visit application', function () { | ||
cy.visit(Cypress.env('CYPRESS_BASE_URL')) | ||
cy.percySnapshot() | ||
}) | ||
|
||
it('Should inform me when application is ready to use', function () { | ||
cy.contains(messages.READY) | ||
cy.percySnapshot() | ||
}) | ||
|
||
it('As a User I should be able to select an image from my machine to remove Background', function () { | ||
cy.get('#js-image-picker').attachFile('adult-1868750_1920.jpg') | ||
|
||
cy.contains(messages.PROCESS_STARTED) | ||
cy.contains(messages.PROCESS_FINISHED) | ||
cy.percySnapshot() | ||
}) | ||
|
||
it('Should be able to pick suggested image from provided options', function () { | ||
cy.get('.suggestions__option').eq(2).click() | ||
|
||
cy.contains(messages.PROCESS_FINISHED) | ||
cy.percySnapshot() | ||
}) | ||
|
||
it('Should be able to interact with advance options', function () { | ||
cy.get('#internalResolution').should('not.be.visible') | ||
cy.get('[aria-controls="advance-options"]').click() | ||
cy.get('#internalResolution').should('be.visible') | ||
cy.percySnapshot() | ||
|
||
cy.get('[aria-controls="advance-options"]').click() | ||
cy.get('#internalResolution').should('not.be.visible') | ||
cy.percySnapshot() | ||
}) | ||
|
||
it('Should be able to specify background colour for processed image', function () { | ||
cy.get('[aria-controls="advance-options"]').click() | ||
cy.get('#backgroundColour').invoke('val', '#ff0000').trigger('change') | ||
|
||
cy.contains(messages.PROCESS_FINISHED) | ||
cy.percySnapshot() | ||
}) | ||
|
||
it('Should be able to download processed image', function () { | ||
cy.get('#js-download-link').click() | ||
cy.percySnapshot() | ||
}) | ||
}) |