-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(frontend): add resize image process e2e tests
- Loading branch information
1 parent
aaf9f70
commit 21cb9b3
Showing
26 changed files
with
142 additions
and
17 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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import * as path from 'path' | ||
|
||
const testResize = () => { | ||
// Upload an image file. | ||
cy.get('[data-cy="image-dropzone"] input').selectFile('cypress/fixtures/test_image.png', { | ||
force: true | ||
}) | ||
|
||
// Set resize width and height. | ||
cy.get('[data-cy="input-resize-width"]').type('150') | ||
cy.get('[data-cy="input-resize-height"]').type('150') | ||
|
||
const checkboxReduction = cy.get('[data-cy="cbox-resize-reduction"]') | ||
checkboxReduction.click() | ||
checkboxReduction.should('have.data', 'state', 'checked') | ||
|
||
// Add trim operation. | ||
cy.get('[data-cy="resize-operation-trim"]').click({ | ||
force: true | ||
}) | ||
|
||
cy.get('[data-cy="cbox-trim-line-art"]').click() | ||
cy.get('[data-cy="input-trim-threshold"]').clear().type('4') | ||
|
||
cy.get('[data-cy="button-resize"]') | ||
.click() | ||
.then(() => { | ||
// Simulate waiting for a server response. | ||
cy.wait(3000) | ||
|
||
cy.get('[data-cy="button-download"]').click() | ||
|
||
const downloadsFolder = Cypress.config('downloadsFolder') | ||
const outputTestFilePath = path.join(downloadsFolder, 'test_image.png') | ||
cy.readFile(outputTestFilePath).should('exist') | ||
}) | ||
} | ||
|
||
// NOTE: Backend server should be running | ||
describe('Resize image', () => { | ||
beforeEach(() => { | ||
cy.skipTourAndAcceptCookies() | ||
}) | ||
|
||
context('Desktop', () => { | ||
before(() => { | ||
cy.setDesktopViewport() | ||
}) | ||
|
||
it('should correctly resize image and download it', () => { | ||
cy.visit('/') | ||
cy.wait(1500) | ||
|
||
cy.selectTab({ tabName: 'resize' }) | ||
|
||
testResize() | ||
}) | ||
}) | ||
|
||
context('Mobile', () => { | ||
before(() => { | ||
cy.setMobileViewport() | ||
}) | ||
|
||
it('should correctly resize image and download it', () => { | ||
cy.visit('/') | ||
cy.wait(1500) | ||
|
||
cy.selectTab({ tabName: 'resize', isMobile: true }) | ||
|
||
testResize() | ||
}) | ||
}) | ||
}) |
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
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
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
1 change: 0 additions & 1 deletion
1
...src/widgets/SettingsPanel/TabResize/sections/resize/ResizeExtra/ResizeSelectList/index.ts
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
1 change: 1 addition & 0 deletions
1
...rc/widgets/SettingsPanel/TabResize/sections/resize/ResizeExtra/ResizeSelectsList/index.ts
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 @@ | ||
export { ResizeSelectsList } from './ResizeSelectsList' |
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
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