-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/e2e right panel #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feat/e2e right panel #213
Changes from 3 commits
a9a0881
f352272
b74cdeb
3d9d34b
65e20bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
describe('add new parameter', () => { | ||
it('should add a new parameter successfully', () => { | ||
|
||
cy.landingEditor(); | ||
|
||
// Step 1: Click the add button | ||
cy.get('div.src-web-app-views-beambox-Right-Panels-ConfigPanel-SaveConfigButton-module__btn--uh2Fr') | ||
.find('img[src="img/icon-plus.svg"]') | ||
.click(); | ||
|
||
// Step 2: Input value 'Test' | ||
cy.get('input.ant-input.css-dev-only-do-not-override-1o1wjx9.text-input') | ||
.type('Test'); | ||
|
||
// Step 3: Click the OK button | ||
cy.get('button.ant-btn.css-dev-only-do-not-override-1o1wjx9.ant-btn-primary') | ||
.contains('OK') | ||
.click(); | ||
|
||
// Step 4: Click span.ant-select-selection-search | ||
cy.get('div.ant-select-selector') | ||
.click(); | ||
|
||
// Step 5: Check if 'Test' exists in the list | ||
cy.get('div.ant-select-item-option-content') | ||
.should('exist') | ||
.then($elements => { | ||
const texts = $elements.map((_, el) => Cypress.$(el).text()).get(); | ||
expect(texts).to.include('Test'); | ||
}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
describe('power input validation', () => { | ||
beforeEach(() => { | ||
cy.landingEditor(); | ||
}); | ||
|
||
it('should not show warning when power is 10 or above', () => { | ||
cy.get('#power-input').clear().type('10'); | ||
cy.get('#power-input').type('{enter}'); | ||
cy.get('.src-web-app-views-beambox-Right-Panels-ConfigPanel-Block-module__warning--aboql') | ||
.should('not.exist'); | ||
|
||
cy.get('#power-input').clear().type('11'); | ||
cy.get('#power-input').type('{enter}'); | ||
cy.get('.src-web-app-views-beambox-Right-Panels-ConfigPanel-Block-module__warning--aboql') | ||
.should('not.exist'); | ||
}); | ||
|
||
it('should handle decimal values correctly', () => { | ||
cy.get('#power-input').clear().type('9.9'); | ||
cy.get('#power-input').type('{enter}'); | ||
cy.get('.src-web-app-views-beambox-Right-Panels-ConfigPanel-Block-module__warning--aboql') | ||
.should('be.visible'); | ||
|
||
cy.get('#power-input').clear().type('10.1'); | ||
cy.get('#power-input').type('{enter}'); | ||
cy.get('.src-web-app-views-beambox-Right-Panels-ConfigPanel-Block-module__warning--aboql') | ||
.should('not.exist'); | ||
}); | ||
|
||
it('should handle extreme low values', () => { | ||
cy.get('#power-input').clear().type('0'); | ||
cy.get('#power-input').type('{enter}'); | ||
// should have number 1 as the lowest value | ||
cy.get('#power-input').should('have.value', '1'); | ||
cy.get('.src-web-app-views-beambox-Right-Panels-ConfigPanel-Block-module__warning--aboql') | ||
.should('be.visible'); | ||
|
||
cy.get('#power-input').clear().type('-1'); | ||
cy.get('#power-input').type('{enter}'); | ||
cy.get('.src-web-app-views-beambox-Right-Panels-ConfigPanel-Block-module__warning--aboql') | ||
.should('be.visible'); | ||
}); | ||
|
||
it('should handle extreme high values', () => { | ||
cy.get('#power-input').clear().type('100'); | ||
cy.get('#power-input').type('{enter}'); | ||
cy.get('.src-web-app-views-beambox-Right-Panels-ConfigPanel-Block-module__warning--aboql') | ||
.should('not.exist'); | ||
|
||
cy.get('#power-input').clear().type('1000'); | ||
cy.get('#power-input').type('{enter}'); | ||
cy.get('.src-web-app-views-beambox-Right-Panels-ConfigPanel-Block-module__warning--aboql') | ||
.should('not.exist'); | ||
}); | ||
|
||
it('should handle non-numeric input', () => { | ||
cy.get('#power-input').clear().type('abc'); | ||
cy.get('#power-input').type('{enter}'); | ||
cy.get('#power-input').should('have.value', '15.0'); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
describe('machine selection and svg dimensions test', () => { | ||
beforeEach(() => { | ||
cy.landingEditor(); | ||
}); | ||
|
||
// 20W Diode LaserCustom | ||
it('toggle-single-full-color-layer', () => { | ||
// Click on the top bar menu container | ||
cy.get('.src-web-app-components-beambox-top-bar-TopBar-module__menu--Oh39C').click(); | ||
|
||
// Click on the "Edit" submenu | ||
cy.contains('li.rc-menu__submenu', 'Edit').click(); | ||
|
||
// Click on "Document Settings" | ||
cy.contains('li[role="menuitem"]', 'Document Settings').click(); | ||
|
||
// Select the machine from the dropdown | ||
cy.get('span.ant-select-selection-item').click({ multiple: true, force: true }); | ||
cy.contains('.ant-select-item-option-content', 'Ador').click(); | ||
|
||
// Click the confirm button | ||
cy.contains('span', 'Save') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
.should('be.visible') | ||
.and('not.be.disabled') | ||
.click({ force: true }); | ||
|
||
cy.contains('span.ant-select-selection-item', '20W Diode Laser') | ||
.click(); // Perform the click action | ||
|
||
// Ensure the element is visible before clicking | ||
cy.contains('div.ant-select-item-option-content', 'Printing') | ||
.should('be.visible') // Assert that the element is visible | ||
.click(); // Perform the click action | ||
|
||
// Ensure the button is visible before clicking | ||
cy.contains('button.ant-btn', 'Confirm') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
.should('be.visible') | ||
.click({ force: true }); | ||
|
||
// right click | ||
// 'div#toggle_fullcolor_layer' | ||
// check exist or not : Switch to single color layer | ||
cy.get('div#layerdoubleclick-0') | ||
.rightclick(); | ||
cy.get('div#toggle_fullcolor_layer') | ||
.should('exist', 'Switch to single color layer') | ||
.click(); | ||
|
||
cy.wait(1500); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <cypress/no-unnecessary-waiting> reported by reviewdog 🐶 |
||
|
||
cy.get('div#layerdoubleclick-0') | ||
.rightclick(); | ||
cy.get('div#toggle_fullcolor_layer') | ||
.should('exist', 'Switch to full color layer') | ||
.click(); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use force on click and type calls