Skip to content
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

feat: 1454 smp success on parent step 5 #1546

Merged
merged 56 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
76c3add
feat: create a test for part 2 of Parent tree and SMP
ngunner15 Jul 30, 2024
4e1572a
feat: add test in config
ngunner15 Jul 30, 2024
e462490
feat: click on the 'SMP success on parent' tab
ngunner15 Jul 30, 2024
60162f7
feat: add parent tree fixture
ngunner15 Aug 13, 2024
ff839dc
feat: add title test
ngunner15 Aug 13, 2024
3533ea9
feat: add checkbox test
ngunner15 Aug 15, 2024
3747491
feat: update checkbox test
ngunner15 Aug 15, 2024
5b8d84d
feat: update checkbox test
ngunner15 Aug 16, 2024
48aab8f
feat: add show/hide columns test
ngunner15 Aug 16, 2024
14eb112
feat: add More Options test
ngunner15 Aug 16, 2024
b071399
feat: add calculate metrics test
ngunner15 Aug 19, 2024
1d7b05a
Merge branch 'main' into feat/1454-smp-success-on-parent-step-5
ngunner15 Aug 23, 2024
1679e89
Merge branch 'main' into feat/1454-smp-success-on-parent-step-5
ngunner15 Aug 28, 2024
bb6bb7d
feat: update title
ngunner15 Aug 23, 2024
27a9022
feat: move save progress code inside .then() block
ngunner15 Aug 23, 2024
a4ac152
feat: add checkbox text
ngunner15 Aug 26, 2024
21e109c
fix: title test
ngunner15 Aug 29, 2024
2a46482
fix: update
ngunner15 Sep 3, 2024
031ebb0
fix: remove unwanted code
ngunner15 Sep 3, 2024
74aba56
fix: update
ngunner15 Sep 3, 2024
4489d91
feat: add new upload file for parent tree step-2
ngunner15 Sep 3, 2024
e840b2c
Merge branch 'main' into feat/1454-smp-success-on-parent-step-5
ngunner15 Sep 3, 2024
c89db5c
feat: add scrollintoview
ngunner15 Sep 3, 2024
6a6165c
feat: remove cancel button checks
ngunner15 Sep 3, 2024
f59e30f
Merge branch 'main' into feat/1454-smp-success-on-parent-step-5
ngunner15 Sep 16, 2024
e17112d
fix: remove visibility check
ngunner15 Sep 17, 2024
9c20e4b
Merge branch 'main' into feat/1454-smp-success-on-parent-step-5
ngunner15 Sep 24, 2024
6d6dd3f
feat: add dialog box to check change orchard value
ngunner15 Sep 24, 2024
3008905
feat: remove '+' and '-' sign test
ngunner15 Sep 24, 2024
d7b692a
fix: move helper text test
ngunner15 Sep 24, 2024
f1fa7a7
fix: add condition to check checkbox
ngunner15 Sep 24, 2024
485c3dc
fix: remove it.only
ngunner15 Sep 24, 2024
b870b7c
fix: update
ngunner15 Sep 24, 2024
762fbbc
fix: check checkbox
ngunner15 Sep 24, 2024
42a098f
fix: add comment
ngunner15 Sep 25, 2024
077c5d5
fix: change location code
ngunner15 Sep 25, 2024
c6197db
fix: remove percentage check
ngunner15 Sep 25, 2024
e0aa3cc
Merge branch 'main' into feat/1454-smp-success-on-parent-step-5
ngunner15 Sep 25, 2024
09780b9
fix: add save code
ngunner15 Sep 25, 2024
3895b7e
fix: add force
ngunner15 Sep 25, 2024
0dbb0d4
Merge branch 'main' into feat/1454-smp-success-on-parent-step-5
ngunner15 Oct 1, 2024
8051c79
fix: checkbox logic code
ngunner15 Oct 1, 2024
18fcef1
feat: add save code
ngunner15 Oct 1, 2024
0a3affa
feat: add orchard values check
ngunner15 Oct 2, 2024
d105560
feat: add seedlot status text for GitHub Action rerun
ngunner15 Oct 2, 2024
7767c32
fix: update
ngunner15 Oct 2, 2024
449db88
fix: remove seedlot status code
ngunner15 Oct 2, 2024
c7da8e7
feat: add save code
ngunner15 Oct 2, 2024
98324c3
fix: move save code inside block
ngunner15 Oct 2, 2024
7134cea
Merge branch 'main' into feat/1454-smp-success-on-parent-step-5
ngunner15 Oct 2, 2024
3fb43d5
fix: add blur
ngunner15 Oct 3, 2024
565729a
fix: remove blur
ngunner15 Oct 3, 2024
ddc81a3
feat: add orchard check
ngunner15 Oct 3, 2024
249d4be
feat: add additional orchard code
ngunner15 Oct 3, 2024
2e15589
feat: add timeout
ngunner15 Oct 3, 2024
4a36f25
Merge branch 'main' into feat/1454-smp-success-on-parent-step-5
ngunner15 Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frontend/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export default defineConfig({
'**/a-class-seedlot-reg-form-ownership.cy.ts',
'**/a-class-seedlot-reg-form-orchard.cy.ts',
'**/a-class-seedlot-reg-form-extraction.cy.ts',
'**/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts'
'**/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts',
'**/a-class-seedlot-reg-form-parent-tree-part-2.cy.ts'
],
chromeWebSecurity: false,
retries: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()

cy.get('#collection-location-code')
.should('have.value', locationCode);

// Save changes
cy.saveSeedlotRegFormProgress();
});

// Enter location code for linkage test
Expand Down Expand Up @@ -306,6 +309,12 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()
});

it('[Collection] Checkbox input', () => {
// Change inputs
cy.get('#collection-step-default-checkbox')
.focus()
.check({ force: true })
.blur();

cy.get('#cone-collection-method-checkbox-1')
.focus()
.check({ force: true })
Expand All @@ -316,6 +325,9 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()
.type('Test comment')
.blur();

// Save changes
cy.saveSeedlotRegFormProgress();

// Press next button
cy.get('.seedlot-registration-button-row')
.find('button.form-action-btn')
Expand Down Expand Up @@ -350,7 +362,7 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()
.should('have.value', testPopupAcronym);

cy.get('#interim-location-code')
.should('have.value', '03');
.should('have.value', '01');

cy.get('#interim-use-collection-agency')
.should('be.checked');
Expand Down Expand Up @@ -450,6 +462,9 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()

cy.get('#interim-location-code')
.should('have.value', locationCode);

// Save changes
cy.saveSeedlotRegFormProgress();
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ describe('A Class Seedlot Registration form, Extraction and Storage', () => {

cy.get('#ext-location-code')
.should('have.value', locationCode);

// Save changes
cy.saveSeedlotRegFormProgress();
});
});

Expand Down Expand Up @@ -338,6 +341,9 @@ describe('A Class Seedlot Registration form, Extraction and Storage', () => {

cy.get('#str-location-code')
.should('have.value', locationCode);

// Save changes
cy.saveSeedlotRegFormProgress();
});
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import prefix from '../../../src/styles/classPrefix';
import { THIRTY_SECONDS } from '../../constants';
import { SeedlotRegFixtureType } from '../../definitions';
import { TYPE_DELAY } from '../../constants';

describe('A Class Seedlot Registration form, Orchard', () => {
let regFormData: {
Expand Down Expand Up @@ -362,6 +363,9 @@ describe('A Class Seedlot Registration form, Orchard', () => {
.contains('219 - VERNON - S - PRD')
.click();

// Save changes
cy.saveSeedlotRegFormProgress();

// Add additional orchard
cy.get('.seedlot-orchard-add-orchard')
.find('button')
Expand Down Expand Up @@ -554,62 +558,45 @@ describe('A Class Seedlot Registration form, Orchard', () => {

cy.get('#orchard-is-regional')
.should('be.checked');

cy.get('#orchard-breading-perc-helper-text')
.should('have.text', regFormData.orchard.pollenHelperText);

// Check pollen breeding % error msg
cy.get('#orchard-breading-perc')
.clear()
.type('-1')
.type('-1', { delay: TYPE_DELAY })
.blur();

cy.get('#orchard-breading-perc-error-msg')
.should('have.text', regFormData.orchard.pollenError);

cy.get('#orchard-breading-perc')
.clear()
.type('101')
.type('101', { delay: TYPE_DELAY })
.blur();

cy.get('#orchard-breading-perc-error-msg')
.should('have.text', regFormData.orchard.pollenError);

cy.get('#orchard-breading-perc')
.clear()
.type('21.1576')
.type('21.1576', { delay: TYPE_DELAY })
.blur();

cy.get('#orchard-breading-perc-error-msg')
.should('have.text', regFormData.orchard.pollenError);

// Check '+' and '-' buttons for pollen breeding %
cy.get('#orchard-breading-perc')
.clear()
.type('5')
.type('5', { delay: TYPE_DELAY })
.blur();

cy.get('#orchard-breading-perc-helper-text')
.should('have.text', regFormData.orchard.pollenHelperText);

cy.get(`button.${prefix}--number__control-btn[title="Increment number"]`)
.click();

cy.get('#orchard-breading-perc')
.should('have.value', '15');

cy.get(`button.${prefix}--number__control-btn[title="Decrement number"]`)
.click();

cy.get('#orchard-breading-perc')
.should('have.value', '5');

// Save changes
cy.saveSeedlotRegFormProgress();
});

it('Step complete status', () => {
// Make sure value is loaded
cy.get('#orchard-breading-perc')
.should('have.value', '5');

// Press next button
cy.get('.seedlot-registration-button-row')
.find('button.form-action-btn')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ describe('A Class Seedlot Registration form, Ownership', () => {
.find('p')
.should('have.text', regFormData.ownership.subtitle);

// Check the checkbox if unchecked
cy.get('#default-owner-checkbox')
.then($checkbox => {
if ($checkbox.is(':not(:checked)')) {
cy.get('#default-owner-checkbox').check({ force: true });
// Save changes
cy.saveSeedlotRegFormProgress();
}
})
.should("be.checked");

cy.get(`.${prefix}--accordion__title`)
.find('.item-title-section')
.should('have.text', initialAccordionTitle);
Expand Down Expand Up @@ -207,10 +218,10 @@ describe('A Class Seedlot Registration form, Ownership', () => {

cy.get('#ownership-location-code-0')
.should('have.value', locationCode);
});

// Save changes
cy.saveSeedlotRegFormProgress();
// Save changes
cy.saveSeedlotRegFormProgress();
});
});

it('Owner portion %, reserved % and surplus % display default values', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,82 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and
});
});

it('Check primary and secondary orchard values', () => {
// Press next button
cy.get('.seedlot-registration-button-row')
.find('button.form-action-btn')
.contains('Back')
.click();

// Check primary orchard
cy.get('#primary-orchard-selection')
.then($input => {
const value = $input.val();
if (value === '') {
cy.log('Primary input is empty');
// Do something if the input is empty
cy.get('#primary-orchard-selection')
.siblings(`button.${prefix}--list-box__menu-icon[title="Open"]`)
.click();

cy.get(`.${prefix}--list-box--expanded`)
.find('ul li')
.contains('219 - VERNON - S - PRD')
.click();

// Add additional orchard
cy.get('.seedlot-orchard-add-orchard')
.find('button')
.contains('Add additional orchard')
.click();

cy.get('#secondary-orchard-selection')
.siblings(`button.${prefix}--list-box__menu-icon[title="Open"]`)
.click();

cy.get(`.${prefix}--list-box--expanded`)
.find('ul li')
.contains('222 - VERNON - S - PRD')
.click();

// Save changes
cy.saveSeedlotRegFormProgress();
}
});

// Check secondary orchard
cy.get('#secondary-orchard-selection')
.then($input => {
const value = $input.val();
if (value === '') {
cy.log('Secondary input is empty');
// Do something if the input is empty
cy.get('#secondary-orchard-selection')
.siblings(`button.${prefix}--list-box__menu-icon[title="Open"]`)
.click();

cy.get(`.${prefix}--list-box--expanded`)
.find('ul li')
.contains('222 - VERNON - S - PRD')
.click();

// Save changes
cy.saveSeedlotRegFormProgress();
}
});

// Press next button
cy.get('.seedlot-registration-button-row')
.find('button.form-action-btn')
.contains('Next')
.click();

cy.get('#parentTreeNumber').scrollIntoView();

// Save changes
cy.saveSeedlotRegFormProgress();
});

it('Page title and subtitles', () => {
cy.get('.title-row')
.find('h2')
Expand Down Expand Up @@ -115,7 +191,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and

// Wait for the table to load
cy.wait('@parentTreesUnderVegCode', { timeout: THIRTY_SECONDS }).its('response.statusCode').should('equal', 200);
cy.get('#parentTreeNumber');
cy.get('#parentTreeNumber').scrollIntoView();

// Check error message for negative Cone count
cy.get('#212-coneCount-value-input')
Expand Down Expand Up @@ -217,7 +293,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and

// Wait for the table to load
cy.wait('@parentTreesUnderVegCode', { timeout: THIRTY_SECONDS }).its('response.statusCode').should('equal', 200);
cy.get('#parentTreeNumber');
cy.get('#parentTreeNumber').scrollIntoView();

// Click 'Dothistroma needle blight (DFS)' checkbox
cy.get(`.${prefix}--toolbar-content > span`)
Expand Down Expand Up @@ -301,7 +377,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and

// Wait for the table to load
cy.wait('@parentTreesUnderVegCode', { timeout: THIRTY_SECONDS }).its('response.statusCode').should('equal', 200);
cy.get('#parentTreeNumber');
cy.get('#parentTreeNumber').scrollIntoView();

// Check Download file option
cy.get(`.${prefix}--toolbar-content > span`)
Expand Down Expand Up @@ -368,7 +444,8 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and
.click();

cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`)
.find('button[aria-label="close"]')
.find('button')
.contains('Cancel')
.click();

cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`)
Expand Down Expand Up @@ -456,6 +533,8 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and
cy.wait('@parentTreesUnderVegCode', { timeout: THIRTY_SECONDS }).its('response.statusCode').should('equal', 200);
cy.get('#parentTreeNumber');

cy.get(`.${prefix}--pagination`).scrollIntoView();

const dropdownNumber = '20';
// Number of item dropdown
cy.get(`.${prefix}--pagination__left`)
Expand Down Expand Up @@ -518,6 +597,8 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and
cy.wait('@parentTreesUnderVegCode', { timeout: THIRTY_SECONDS }).its('response.statusCode').should('equal', 200);
cy.get('#parentTreeNumber');

cy.get('.info-sections-row').scrollIntoView();

// Check info sections not visible in DOM
cy.get('.info-section-sub-title')
.should('not.exist');
Expand Down
Loading
Loading