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

Add test for BI-2057. #147

Merged
merged 6 commits into from
Sep 20, 2024
Merged
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
35 changes: 35 additions & 0 deletions src/features/BI-2057.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Feature: Sample Tracking

@BI-2057
@debug
Scenario: Sample Tracking
Given a new program is created
Given user logs in as "Cucumber Breeder"
When user selects "*" on program-selection page
And user selects "Import Data" in top-level navigation
And user uploads Germplasm "GermplasmSample.xlsx" file
And user selects 'Import' button
When user sets "GermplasmSort" in List Name field of import page
When user sets "GermplasmSort" in List Description field of import page
And user selects "Confirm" button
# When user selects "Experiments & Observations" in navigation
# When user selects "Import Experiments & Observations" button
# And user uploads Experiments & Observations "EXP.csv" file
# When user selects 'Import' button
# And user selects "Confirm" button
When user selects "Sample Management" in navigation
When user selects "Import Sample Submission" button
And user uploads Genotype Sample "bi_sample_submission.xls" file
When user selects 'Import' button
When user sets "Sample" in Project Name field of import page
And user selects "Confirm" button
And user pause for "10" seconds
When user selects "Sample Management" in navigation
Then user can see row "1" rows in a table
Then user can see "Project Name" column header
Then user can see "Created Date" column header
Then user can see "Created By" column header
Then user can see "Submission Status" column header
Then user can see "Submitted Date" column header
Then user can see "Vendor Order ID" column header
Then user can see "Vendor Status" column header
1 change: 0 additions & 1 deletion src/features/BI-2160.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Feature: Display the full name in the table and details pane for ontology
Given a new program is created

@BI-2160
@debug
Scenario Outline: Display the full name in the table and details pane for ontology
Given user logs in as "Cucumber Breeder"
When user selects "*" on program-selection page
Expand Down
1 change: 0 additions & 1 deletion src/features/BI-2164.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Background: Create a new list referencing existing GIDs


@BI-2164
@debug
@BUG_BI-2260
Scenario Outline: All of the information associated with a Germplasm Details page
Given a new program is created
Expand Down
2 changes: 1 addition & 1 deletion src/files/ExperimentsImport/BI-1146-multi-exp-test.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Germplasm Name,Germplasm GID,Test (T) or Check (C),Exp Title ,Exp Description,Ex
Test,1,C,Trial 5 test2,second trial test,plot test2,phenotyping test,New Study test2,New Location test2,2020,1 - test2,0,2,4,50,Jam application,
Test,1,T,Trial 5 test2,second trial,plot test2,phenotyping test,Study two test2,Location Two test2,2020,2 - test2,0,2,4,51,Jelly application,
Test,1,C,Trial 5 test2,second trial,plot test2,phenotyping test,Study three test2, Location Three test2,2020,2 - test2,0,2,4,52,Juice application,
Test,1, ,Trial 5 test2,second trial,plot test2,phenotyping test,Study four test2, Location Three test2,1958,1 - test2,0,2,4,53,EATING application,
Test,1, ,Trial 5 test2,second trial,plot test2,phenotyping test,Study four test2, Location Three test2,1958,1 - test2,0,2,4,53,EATING application,
4 changes: 2 additions & 2 deletions src/files/ExperimentsImport/BI-1146-starter.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Germplasm Name,Germplasm GID,Test (T) or Check (C),Exp Title ,Exp Description,Exp Unit,Exp Type,Env,Env Location,Env Year,Exp Unit ID,Exp Replicate #,Exp Block #,Row,Column,Exp Trt Factor Name,ObsUnitID,Treatment Factors
Test,1,C,New Trial DRP45,A new trial DRP5,plot,phenotyping,New Study DRP5,New Location DRP5,1993,9393,1,2,4,5,Jam application,test,test
Germplasm Name,Germplasm GID,Test (T) or Check (C),Exp Title ,Exp Description,Exp Unit,Exp Type,Env,Env Location,Env Year,Exp Unit ID,Exp Replicate #,Exp Block #,Row,Column,Exp Trt Factor Name,Treatment Factors,ObsUnitID
Test,1,C,New Trial DRP45,A new trial DRP5,plot,phenotyping,New Study DRP5,New Location DRP5,1993,9393,1,2,4,5,Jam application,test,
5 changes: 5 additions & 0 deletions src/files/ExperimentsImport/EXP - Case.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Germplasm Name,Germplasm GID,Test (T) or Check (C),Exp Title ,Exp Description,Exp Unit,Exp Type,ENV,Env Location,ENV YEAR,Exp Unit ID,Exp Replicate #,Exp Block #,Row,Column,Lat,Long,Elevation,RTK,Treatment Factors,ObsUnitID
Germplas127,1,C,New Trial DRP1,A new trial DRP,plot,phenotyping,New Study 15,New Location DRP6,2000,9390,1,2,4,5,,,,,Jam application,
Germplas128,2,C,New Trial DRP1,A new trial DRP,plot,phenotyping,New Study 16,New Location DRP7,2000,9391,1,2,4,5,,,,,Jam application,
Germplas129,3,C,New Trial DRP1,A new trial DRP,plot,phenotyping,New Study 17,New Location DRP8,2000,9392,1,2,4,5,,,,,Jam application,
Germplas130,4,C,New Trial DRP1,A new trial DRP,plot,phenotyping,New Study 18,New Location DRP9,2000,9393,1,2,4,5,,,,,Jam application,
10 changes: 5 additions & 5 deletions src/files/ExperimentsImport/EXP.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Germplasm Name,Germplasm GID,Test (T) or Check (C),Exp Title ,Exp Description,Exp Unit,Sub-Obs Unit,Exp Type,Env,Env Location,Env Year,Exp Unit ID,Sub Unit ID,Exp Replicate #,Exp Block #,Row,Column,Lat,Long,Elevation,RTK,Treatment Factors,ObsUnitID
Germplas127,1,C,New Trial DRP1,A new trial DRP,plot,,phenotyping,New Study 15,New Location DRP6,2000,9390,,1,2,4,5,,,,,Jam application,
Germplas128,2,C,New Trial DRP1,A new trial DRP,plot,,phenotyping,New Study 16,New Location DRP7,2000,9391,,1,2,4,5,,,,,Jam application,
Germplas129,3,C,New Trial DRP1,A new trial DRP,plot,,phenotyping,New Study 17,New Location DRP8,2000,9392,,1,2,4,5,,,,,Jam application,
Germplas130,4,C,New Trial DRP1,A new trial DRP,plot,,phenotyping,New Study 18,New Location DRP9,2000,9393,,1,2,4,5,,,,,Jam application,
Germplasm Name,Germplasm GID,Test (T) or Check (C),Exp Title ,Exp Description,Exp Unit,Exp Type,Env,Env Location,Env Year,Exp Unit ID,Exp Replicate #,Exp Block #,Row,Column,Lat,Long,Elevation,RTK,Treatment Factors,ObsUnitID
Germplas127,1,C,New Trial DRP1,A new trial DRP,plot,phenotyping,New Study 15,New Location DRP6,2000,9390,1,2,4,5,,,,,Jam application,
Germplas128,2,C,New Trial DRP1,A new trial DRP,plot,phenotyping,New Study 16,New Location DRP7,2000,9391,1,2,4,5,,,,,Jam application,
Germplas129,3,C,New Trial DRP1,A new trial DRP,plot,phenotyping,New Study 17,New Location DRP8,2000,9392,1,2,4,5,,,,,Jam application,
Germplas130,4,C,New Trial DRP1,A new trial DRP,plot,phenotyping,New Study 18,New Location DRP9,2000,9393,1,2,4,5,,,,,Jam application,
10 changes: 5 additions & 5 deletions src/files/ExperimentsImport/EXP2.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Germplasm Name,Germplasm GID,Test (T) or Check (C),Exp Title ,Exp Description,Exp Unit,Sub-Obs Unit,Exp Type,Env,Env Location,Env Year,Exp Unit ID,Sub Unit ID,Exp Replicate #,Exp Block #,Row,Column,Lat,Long,Elevation,RTK,Treatment Factors,ObsUnitID
Germplas127,1,C,New Trial DRP2,A new trial DRP,plot,,phenotyping,New Study 15,New Location DRP6,2000,9390,,1,2,4,5,,,,,Jam application,
Germplas128,2,C,New Trial DRP2,A new trial DRP,plot,,phenotyping,New Study 16,New Location DRP7,2000,9391,,1,2,4,5,,,,,Jam application,
Germplas129,3,C,New Trial DRP2,A new trial DRP,plot,,phenotyping,New Study 17,New Location DRP8,2000,9392,,1,2,4,5,,,,,Jam application,
Germplas130,4,C,New Trial DRP2,A new trial DRP,plot,,phenotyping,New Study 18,New Location DRP9,2000,9393,,1,2,4,5,,,,,Jam application,
Germplasm Name,Germplasm GID,Test (T) or Check (C),Exp Title ,Exp Description,Exp Unit,Exp Type,Env,Env Location,Env Year,Exp Unit ID,Exp Replicate #,Exp Block #,Row,Column,Lat,Long,Elevation,RTK,Treatment Factors,ObsUnitID
Germplas127,1,C,New Trial DRP2,A new trial DRP,plot,phenotyping,New Study 15,New Location DRP6,2000,9390,1,2,4,5,,,,,Jam application,
Germplas128,2,C,New Trial DRP2,A new trial DRP,plot,phenotyping,New Study 16,New Location DRP7,2000,9391,1,2,4,5,,,,,Jam application,
Germplas129,3,C,New Trial DRP2,A new trial DRP,plot,phenotyping,New Study 17,New Location DRP8,2000,9392,1,2,4,5,,,,,Jam application,
Germplas130,4,C,New Trial DRP2,A new trial DRP,plot,phenotyping,New Study 18,New Location DRP9,2000,9393,1,2,4,5,,,,,Jam application,
10 changes: 5 additions & 5 deletions src/files/ExperimentsImport/EXPBad.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Germplasm Name,Germplasm GID,Test (T) or Check (C),Exp Title ,Exp Description,Exp Unit,Sub-Obs Unit,Exp Type,Env,Env Location,Env Year,Exp Unit ID,Sub Unit ID,Exp Replicate #,Exp Block #,Row,Column,Lat,Long,Elevation,RTK,Treatment Factors,ObsUnitID
Germplas140,1,C,New Trial DRP,A new trial DRP,plott,,phenotyping,New Study 15,New Location DRP6,2000,9390,,1,2,4,5,,,,,Jam application,
Germplas141,2,C,New Trial DRP,A new trial DRP,plot,,phenotyping,New Study 16,New Location DRP7,2000,9391,,1,2,4,5,,,,,,
Germplas142,,C,New Trial DRP,A new trial DRP,plot,,phenotyping,New Study 17,New Location DRP8,,9392,,1,2,4,5,,,,,Jam application,
Germplas143,4,C,New Trial DRP,A new trial DRP,3,,phenotyping,,New Location DRP9,2000,9393,,1,2,4,5,,,,,Jam application,
Germplasm Name,Germplasm GID,Test (T) or Check (C),Exp Title ,Exp Description,Exp Unit,Exp Type,Env,Env Location,Env Year,Exp Unit ID,Exp Replicate #,Exp Block #,Row,Column,Lat,Long,Elevation,RTK,Treatment Factors,ObsUnitID
Germplas140,1,C,New Trial DRP,A new trial DRP,plott,phenotyping,New Study 15,New Location DRP6,2000,9390,1,2,4,5,,,,,Jam application,
Germplas141,2,C,New Trial DRP,A new trial DRP,plot,phenotyping,New Study 16,New Location DRP7,2000,9391,1,2,4,5,,,,,,
Germplas142,,C,New Trial DRP,A new trial DRP,plot,phenotyping,New Study 17,New Location DRP8,,9392,1,2,4,5,,,,,Jam application,
Germplas143,4,C,New Trial DRP,A new trial DRP,3,phenotyping,,New Location DRP9,2000,9393,1,2,4,5,,,,,Jam application,
10 changes: 5 additions & 5 deletions src/files/ExperimentsImport/EXPBadTitle.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Germplasm Name,Germplasm GID,Test (T) or Check (C),Exp Title ,Exp Description,Exp Unit,Sub-Obs Unit,Exp Type,Env,Env Location,Env Year,Exp Unit ID,Sub Unit ID,Exp Replicate #,Exp Block #,Row,Column,Lat,Long,Elevation,RTK,Treatment Factors,ObsUnitID
Germplas127,1,C,New Trial DRP,A new trial DRP,plot,multiple fruit,phenotyping,New Study 15,New Location DRP6,2000,9390,1,1,2,4,5,,,,,Jam application,
Germplas128,2,C,New Trial DRP 1,A new trial DRP,plot,multiple fruit,phenotyping,New Study 16,New Location DRP7,2000,9391,2,1,2,4,5,,,,,Jam application,
Germplas129,3,C,New Trial DRP,A new trial DRP,plot,multiple fruit,phenotyping,New Study 17,New Location DRP8,2000,9392,3,1,2,4,5,,,,,Jam application,
Germplas130,4,C,New Trial DRP,A new trial DRP,plot,multiple fruit,phenotyping,New Study 18,New Location DRP9,2000,9393,1,1,2,4,5,,,,,Jam application,
Germplasm Name,Germplasm GID,Test (T) or Check (C),Exp Title ,Exp Description,Exp Unit,Exp Type,Env,Env Location,Env Year,Exp Unit ID,Exp Replicate #,Exp Block #,Row,Column,Lat,Long,Elevation,RTK,Treatment Factors,ObsUnitID
Germplas127,1,C,New Trial DRP,A new trial DRP,plot,phenotyping,New Study 15,New Location DRP6,2000,9390,1,2,4,5,,,,,Jam application,
Germplas128,2,C,New Trial DRP 1,A new trial DRP,plot,phenotyping,New Study 16,New Location DRP7,2000,9391,1,2,4,5,,,,,Jam application,
Germplas129,3,C,New Trial DRP,A new trial DRP,plot,phenotyping,New Study 17,New Location DRP8,2000,9392,1,2,4,5,,,,,Jam application,
Germplas130,4,C,New Trial DRP,A new trial DRP,plot,phenotyping,New Study 18,New Location DRP9,2000,9393,1,2,4,5,,,,,Jam application,
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 11 additions & 0 deletions src/page_objects/sampleManagementPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
url: function () {
return this.api.launchUrl;
},
elements: {
header: {
selector: "//h3[text()='Sample Management']",
locateStrategy: "xpath",
},
},
};
63 changes: 37 additions & 26 deletions src/step_definitions/importSteps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const experimentsFolder = path.join(
"files",
"ExperimentsImport"
);
const genotypeSamplesFolder = path.join(__basedir, "src", "files", "GenotypeSamplesImport");

When(
/^user sets "([^"]*)" in List Name field of import page$/,
Expand Down Expand Up @@ -271,15 +272,12 @@ When(
}
);

When(
/^user uploads Sample Submission "([^"]*)" file$/,
async function (args1) {
await importPage.setValue(
'input[type="file"]',
path.resolve(experimentsFolder, args1)
);
}
);
When(/^user uploads Sample Submission "([^"]*)" file$/, async function (args1) {
await importPage.setValue(
'input[type="file"]',
path.resolve(experimentsFolder, args1)
);
});

Then(/^user can see "([^"]*)" preview table$/, async function (args1) {
await importPage.assert.visible("#import-experiment div.b-table");
Expand Down Expand Up @@ -332,24 +330,37 @@ Then(/^user can see "([^"]*)" in preview table$/, async function (args1) {
);
});

Then(/^user can see "([^"]*)" tab in Import Data page$/, async function(args1) {
switch (args1) {
case "Genotypic Data":
await importPage.assert.visible("@genotypicDataTab");
break;
default:
console.log("Unable to find " + args1);
break;
Then(
/^user can see "([^"]*)" tab in Import Data page$/,
async function (args1) {
switch (args1) {
case "Genotypic Data":
await importPage.assert.visible("@genotypicDataTab");
break;
default:
console.log("Unable to find " + args1);
break;
}
}

});

When('user sets {string} in Project Name field of import page', async function(s) {
await importPage.setValue("@projectNameField", s);
})
);

Then('user can see {string} on preview table', async function(s) {
await importPage.assert.visible({selector:`//*[contains(text(), "${s}")]`, locateStrategy:"xpath"});
})
When(
"user sets {string} in Project Name field of import page",
async function (s) {
await importPage.setValue("@projectNameField", s);
}
);

Then("user can see {string} on preview table", async function (s) {
await importPage.assert.visible({
selector: `//*[contains(text(), "${s}")]`,
locateStrategy: "xpath",
});
});

When("user uploads Genotype Samples {string} file", async function (file) {
await importPage.setValue(
'input[type="file"]',
path.resolve(experimentsFolder, args1)
);
});
8 changes: 8 additions & 0 deletions src/step_definitions/sampleManagementSteps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { client } = require("nightwatch-api");
const { Given, Then, When } = require("@cucumber/cucumber");
const sampleManagementPage = client.page.sampleManagementPage();
const page = client.page.page();

Then("user can see Sample Management page", async function () {
await sampleManagementPage.assert.visible("@header");
});
Loading