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

IBP-6097: implement germplasm list cross expansion automation #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,35 @@ export default class GermplasmListPage {
this.openGermplasmListAction("cloneListButton");
}

addDisplayedColumn(columnName: string) {
getIframeBody().then(($iframe) => {
cy.wrap($iframe).find('#columnMenu').should('exist').click();
cy.wrap($iframe).find('label.form-check-label').contains(columnName).click();
cy.intercept('GET', `**/search?*`).as('filterList');
cy.wrap($iframe).find('[data-test="displayColumnApplyButton"]').click();

cy.wait('@filterList').then((interception) => {
expect(interception.response.statusCode).to.be.equal(200);
});
this.addEntryDetailsContext.variableName = columnName;
});
}

selectExpansionLevel() {
getIframeBody().then(($iframe) => {
cy.wrap($iframe).find('[data-test="specifyExpansionLevelButton"]').should('exist').click();
cy.wrap($iframe).find('#generationLevel').should('exist').select("2");
cy.intercept('PUT', `**/pedigree-generation-level?*`).as('pedigreeGenerationLevelUpdate');
cy.wrap($iframe).find('[data-test="crossExpansionApplyButton"]').click();
});
}

checkCrossExpansionUpdate() {
cy.wait('@pedigreeGenerationLevelUpdate').then((interception) => {
expect(interception.response.statusCode).to.equal(200);
})
}

/*
Returns a radom value in range from 1 to 10
*/
Expand Down
10 changes: 9 additions & 1 deletion cypress/integration/pageobjects/studies/import-crosses-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,12 @@ export default class ImportCrossesPage {
getIframeBody().find('[data-test="crossesPreviewNextButton"]').should('be.visible').click();
}

}
processAutomaticNamingCrossesImport() {
this.specifyBreedingMethod();
this.goToNamingAndHarvestDetails();
this.specifyAutomaticNaming();
this.specifyHarvestDetails();
this.goToPreviewCrosses();
this.goToSaveList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ As a user
I should be able to add cross column to a germplasm list and fill with cross expansion

Background:
Given a cross list already exists
Given I am on the Manage Studies page of specified program
And I opened a study with RCBD design
And I imported a cross and created a cross list
And I am on the Germplasm Lists page of specified program

@TestCaseKey=IBP-T4154
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { And, Then, When } from 'cypress-cucumber-preprocessor/steps';
import CreateStudyPage from '../../../pageobjects/studies/create-study-page';
import ImportCrossesPage from '../../../pageobjects/studies/import-crosses-page';
import SaveListTreeModalPage from '../../../pageobjects/studies/save-list-tree-modal-page';
import GermplasmListsBetaPage from '../../../pageobjects/germplasm-lists/germplasm-lists-beta-page';
import AddEntryDetailsContext from '../add-entry-details/add-entry-details.context';
import GermplasmListPage from '../../../pageobjects/germplasm-lists/germplasm-lists-page';

const createStudyPage = new CreateStudyPage();
const importCrossesPage = new ImportCrossesPage();
const saveListTreeModalPage = new SaveListTreeModalPage();
const searchPage = new GermplasmListsBetaPage();

const addEntryDetailsContext = new AddEntryDetailsContext();
const germplasmListPage = new GermplasmListPage(addEntryDetailsContext);

let listName = 'Cross-' + Date.now();

And('I imported a cross and created a cross list', () => {
let studyName = Cypress.env('rcbdStudy');
createStudyPage.clickStudyAction('Export crossing template', 'Crossing options');
cy.verifyDownload(`CrossingTemplate-${studyName}.xls`);
createStudyPage.clickStudyAction("Import Crosses", "Crossing options");

importCrossesPage.uploadFile(`CrossingTemplate-${studyName}.xls`);
importCrossesPage.processAutomaticNamingCrossesImport();

saveListTreeModalPage.setListName(listName);
saveListTreeModalPage.save();
});

When('I open the cross list', () => {
searchPage.selectListFilteredByListName(listName);
});

And('I add cross column', () => {
germplasmListPage.addDisplayedColumn('CROSS');
});

And('I fill the column with cross expansion', () => {
germplasmListPage.selectExpansionLevel();
});

Then('I should see the cross expansion value of the entries', () => {
germplasmListPage.checkCrossExpansionUpdate();
});