Skip to content

Commit a01426c

Browse files
committed
feat(integration-testing): Integration Testing | 009 - Added integration testing
1 parent f2eff97 commit a01426c

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed
22.7 KB
Loading
Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,58 @@
11
/// <reference types="cypress" />
22

3-
describe('Application', () => {
3+
const messages = {
4+
READY: 'Application is ready to use',
5+
PROCESS_STARTED: 'Processing your image.',
6+
PROCESS_FINISHED: 'Image has been processed.'
7+
}
8+
9+
describe('BackgroundRemove Application', () => {
410
it('As a User I should be able to visit application', function () {
511
cy.visit(Cypress.env('CYPRESS_BASE_URL'))
612
cy.percySnapshot()
713
})
14+
15+
it('Should inform me when application is ready to use', function () {
16+
cy.contains(messages.READY)
17+
cy.percySnapshot()
18+
})
19+
20+
it('As a User I should be able to select an image from my machine to remove Background', function () {
21+
cy.get('#js-image-picker').attachFile('adult-1868750_1920.jpg')
22+
23+
cy.contains(messages.PROCESS_STARTED)
24+
cy.contains(messages.PROCESS_FINISHED)
25+
cy.percySnapshot()
26+
})
27+
28+
it('Should be able to pick suggested image from provided options', function () {
29+
cy.get('.suggestions__option').eq(2).click()
30+
31+
cy.contains(messages.PROCESS_FINISHED)
32+
cy.percySnapshot()
33+
})
34+
35+
it('Should be able to interact with advance options', function () {
36+
cy.get('#internalResolution').should('not.be.visible')
37+
cy.get('[aria-controls="advance-options"]').click()
38+
cy.get('#internalResolution').should('be.visible')
39+
cy.percySnapshot()
40+
41+
cy.get('[aria-controls="advance-options"]').click()
42+
cy.get('#internalResolution').should('not.be.visible')
43+
cy.percySnapshot()
44+
})
45+
46+
it('Should be able to specify background colour for processed image', function () {
47+
cy.get('[aria-controls="advance-options"]').click()
48+
cy.get('#backgroundColour').invoke('val', '#ff0000').trigger('change')
49+
50+
cy.contains(messages.PROCESS_FINISHED)
51+
cy.percySnapshot()
52+
})
53+
54+
it('Should be able to download processed image', function () {
55+
cy.get('#js-download-link').click()
56+
cy.percySnapshot()
57+
})
858
})

0 commit comments

Comments
 (0)