Skip to content
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
7 changes: 6 additions & 1 deletion src/features/OntologyImportBreeder.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Feature: Ontology Import (10 Scenarios)
And user can see "Abort" button
And user see a list of ontology terms in a table
And user can see "Name" column header
And user can see "Term Type" column header
And user can see "Trait" column header
And user can see "Method" column header
And user can see "Scale Class" column header
Expand Down Expand Up @@ -80,6 +81,7 @@ Feature: Ontology Import (10 Scenarios)
Then user can see banner contains "Imported ontology terms have been added to Snacks."
And user can see Ontology table
And user can see "Name" column header
And user can see "Term Type" column header
And user can see "Trait" column header
And user can see "Method" column header
And user can see "Scale Class" column header
Expand All @@ -94,6 +96,7 @@ Feature: Ontology Import (10 Scenarios)
Then user can see banner contains "Imported ontology terms have been added to Snacks."
And user can see Ontology table
And user can see "Name" column header
And user can see "Term Type" column header
And user can see "Trait" column header
And user can see "Method" column header
And user can see "Scale Class" column header
Expand All @@ -117,6 +120,7 @@ Feature: Ontology Import (10 Scenarios)
Then user can see banner contains "Imported ontology terms have been added to Snacks."
And user can see Ontology table
And user can see "Name" column header
And user can see "Term Type" column header
And user can see "Trait" column header
And user can see "Method" column header
And user can see "Scale Class" column header
Expand Down Expand Up @@ -195,8 +199,9 @@ Feature: Ontology Import (10 Scenarios)
Then user can see "4" row "2" "Method Description" field "Method description exceeds 30 character limit" message

@BI-1273
Scenario: Import Traits - invalid method and scale classes
Scenario: Import Traits - invalid method and scale classes and term type
And user uploads "test_traits_invalidFields.xlsx" file
And user selects 'Import' button
Then user can see "2" row "1" "Method class" field "Invalid method class value" message
Then user can see "3" row "2" "Scale class" field "Invalid scale class value" message
Then user can see "3" row "3" "Term Type" field "Invalid term type" message
11 changes: 7 additions & 4 deletions src/features/OntologyTermCreateGeneralBehavior.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Feature: Ontology Term Create - General Behavior
Scenario: Ontology Term Create - New Ontology form elements
Given user selects "New Term" button
Then user can see 'Ontology Term Name' field on ontology list page
Then user can see 'Term Type' dropdown on ontology list page
Then user can see 'Full Name' field on ontology list page
Then user can see 'Description' field on ontology list page
Then user can see 'Entity' field on ontology list page
Expand All @@ -30,6 +31,7 @@ Feature: Ontology Term Create - General Behavior
@BI-944
Scenario: Ontology Term Create - Trait entity auto-complete behavior, not already in db
Given user selects "New Term" button
When user selects "<term_type>" in 'Term Type' dropdown on ontology list page
When user sets "<ont_term_name>" in 'Name' field on ontology list page
When user sets "<trait_description>" in 'Full Name' field on ontology list page
When user sets "<trait_description>" in 'Description' field on ontology list page
Expand All @@ -44,8 +46,8 @@ Feature: Ontology Term Create - General Behavior
Then user can see "*" as suggested text in 'Entity' field on ontology list page

Examples:
| ont_term_name | trait_description | new_entity | trait_attribute | method_description |
| * | TestTraitDesc * | NewEntity * | TestAttribute * | TestMethDesc * |
| term_type | ont_term_name | trait_description | new_entity | trait_attribute | method_description |
| germplasm passport | * | TestTraitDesc * | NewEntity * | TestAttribute * | TestMethDesc * |

@BI-945
Scenario: Ontology Term Create - Synonyms
Expand Down Expand Up @@ -90,6 +92,7 @@ Feature: Ontology Term Create - General Behavior
Scenario: Ontology Term Create - Enter Values, Save
Given user selects 'New Term' button on ontology list page
Given user sets "<ont_term_name>" in 'Name' field on ontology list page
And user selects "<term_type>" in 'Term Type' dropdown on ontology list page
And user sets "<trait_description>" in 'Description' field on ontology list page
And user sets "<trait_entity>" in 'Entity' field on ontology list page
And user sets "<trait_attribute>" in 'Attribute' field on ontology list page
Expand All @@ -104,8 +107,8 @@ Feature: Ontology Term Create - General Behavior
Then user can see "Date" in 'Scale Class' column on ontology list page

Examples:
| ont_term_name | trait_description | trait_entity | trait_attribute | method_description |
| * | Testtraitdesc * | TestTraitEntity * | TestAttribute * | TestMethDesc * |
| term_type | ont_term_name | trait_description | trait_entity | trait_attribute | method_description |
| germplasm passport | * | Testtraitdesc * | TestTraitEntity * | TestAttribute * | TestMethDesc * |

@BI-1310
Scenario: Ontology Term Create - Trait = Entity + Attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ Feature: Ontology Term Create - Method & Scale Class Behavior
Scenario: scale class Ordinal - values post save BI-1258
Given user selects 'New Term' button on ontology list page
Given user sets "<ont_term_name>" in 'Name' field on ontology list page
And user selects "<term_type>" in 'Term Type' dropdown on ontology list page
And user sets "<trait_description>" in 'Description' field on ontology list page
And user sets "<trait_entity>" in 'Entity' field on ontology list page
And user sets "<trait_attribute>" in 'Attribute' field on ontology list page
Expand All @@ -245,8 +246,8 @@ Feature: Ontology Term Create - Method & Scale Class Behavior
And user can see "<second scale category>" in Ordinal second field of Show Details on ontology list page

Examples:
| ont_term_name | trait_description | trait_entity | trait_attribute | method_description | ordinal_value | first scale category | second scale category |
| term* | description* | trait* | traitattribute* | methoddescription* | ordinalvalue* | first* | second* |
| term_type | ont_term_name | trait_description | trait_entity | trait_attribute | method_description | ordinal_value | first scale category | second scale category |
| germplasm attribute | term* | description* | trait* | traitattribute* | methoddescription* | ordinalvalue* | first* | second* |

@BI-1329
Scenario: scale class Nominal - values post save
Expand Down
12 changes: 6 additions & 6 deletions src/files/TraitImport/test_import-csv.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name,Full Name,Description,Synonyms,Status,Tags,Trait Entity,Trait Attribute,Method Description,Method Class,Method Formula,Scale Class,Units,Scale Decimal Places,Scale Lower Limit,Scale Upper Limit,Scale Categories
CanIntCol,Internal color,Color of candy interior under shell.,,Active,,Candy interior,color,color of candy inside,Observation,,Ordinal,,,0,1,0 = white/cream; 1 = light brown; 2 = dark brown
CanIntPea,Peanut presence,Presence of internal peanut.,,Active,,Candy interior,color,is peanut inside,Observation,,Ordinal,,,0,1,0 = peanut absent; 1 = peanut present
FruitFlav,Fruit flavor,Fruit flavor of sample by eating.,,Active,,Package,color,flavor of sample,Observation,,Ordinal,,,0,3,0 = no fruit flavor; 1 = slight fruit flavor; 2 = moderate fruit flavor; 3 = intense fruit flavor
Deformity,Deformity,Presence of deformities.,,Active,,Package,shape,deformities or damage,Observation,,Ordinal,,,0,9,0 = < 10%; 1 = 10%; 2 = 20%; 3 = 30%; 4 = 40%; 5 = 50%; 6 = 60%; 7 = 70%; 8 = 80%; 0 = >90%
Homogenity,Sample homogenity,Observed homogenity in sample shapes.,,Active,,Package,shape,homogeneity of piece sizes,Estimation,,Ordinal,,,1,5,1 = 0% homogeneity; 2 = 25% homogeneous; 3 = 50% homogeneous; 4 = 75% homogeneous; 5 = 100% homogeneity
Name,Full Name,Description,Synonyms,Status,Tags,Trait Entity,Trait Attribute,Method Description,Method Class,Method Formula,Scale Class,Units,Scale Decimal Places,Scale Lower Limit,Scale Upper Limit,Scale Categories,Term Type
CanIntCol,Internal color,Color of candy interior under shell.,,Active,,Candy interior,color,color of candy inside,Observation,,Ordinal,,,0,1,0 = white/cream; 1 = light brown; 2 = dark brown,
CanIntPea,Peanut presence,Presence of internal peanut.,,Active,,Candy interior,color,is peanut inside,Observation,,Ordinal,,,0,1,0 = peanut absent; 1 = peanut present,phenotype
FruitFlav,Fruit flavor,Fruit flavor of sample by eating.,,Active,,Package,color,flavor of sample,Observation,,Ordinal,,,0,3,0 = no fruit flavor; 1 = slight fruit flavor; 2 = moderate fruit flavor; 3 = intense fruit flavor,germplasm ATTRIBUTE
Deformity,Deformity,Presence of deformities.,,Active,,Package,shape,deformities or damage,Observation,,Ordinal,,,0,9,0 = < 10%; 1 = 10%; 2 = 20%; 3 = 30%; 4 = 40%; 5 = 50%; 6 = 60%; 7 = 70%; 8 = 80%; 0 = >90%,
Homogenity,Sample homogenity,Observed homogenity in sample shapes.,,Active,,Package,shape,homogeneity of piece sizes,Estimation,,Ordinal,,,1,5,1 = 0% homogeneity; 2 = 25% homogeneous; 3 = 50% homogeneous; 4 = 75% homogeneous; 5 = 100% homogeneity,Germplasm Passport
Binary file modified src/files/TraitImport/test_import-xls.xls
Binary file not shown.
Binary file modified src/files/TraitImport/test_import-xlsx.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_2.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_case_insensitivity.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_dupCol.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_dupTraitNames.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_exceedsCharLen.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_extraCols.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_invalidFields.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_maxMin.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_missingCol.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_missingFormula.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_missingReqFields.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_missingScaleCat.xlsx
Binary file not shown.
Binary file modified src/files/TraitImport/test_traits_missingUnit.xlsx
Binary file not shown.
79 changes: 52 additions & 27 deletions src/page_objects/ontologyPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,48 +37,73 @@ module.exports = {
selector: "//form//label[@for='Synonyms']/../following-sibling::div",
locateStrategy: "xpath",
},
termType:{
selector: "//*[@id='termTypeField']/div[2]/div/div/div/select",
locateStrategy: "xpath",
},
descriptionField: "#Description",
desriptionErrorText:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(9) > div > div.field-body > div > div > span",
tagsField:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(13) > div > div.field-body > div > div > div > div > div > div.control.is-clearfix > input",
entityField:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(17) > div > div.field-body > div > div > div > div.control.is-clearfix > input",
entityErrorText:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(17) > div > div.field-body > div > div > span:nth-child(3)",
tagsField: {
selector: "//*[@id='tags']/div[2]/div/div/div/div/div/div/input",
locateStrategy: "xpath",
},
entityField: {
selector: "//*[@id='entity']/div[2]/div/div/div/div[1]/input",
locateStrategy: "xpath",
},
entityErrorText: {
selector: "//*[@id='entity']/div[2]/div/div/span",
locateStrategy: "xpath",
},
traitText: {
selector: ".//div[@class='column is-10 mt-4']",
index: 0,
locateStrategy: "xpath",
},
attributeField:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(19) > div > div.field-body > div > div > div > div.control.is-clearfix > input",
attributeErrorText:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(19) > div > div.field-body > div > div > span:nth-child(3)",
methodDescription:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(23) > div > div.field-body > div > div > div > div.control.is-clearfix > input",
attributeField: {
selector: "//*[@id='attribute']/div[2]/div/div/div/div[1]/input",
locateStrategy: "xpath",
},
attributeErrorText: {
selector: "//*[@id='attribute']/div[2]/div/div/span",
locateStrategy: "xpath",
},
methodDescription: {
selector: "//*[@id='methodDescription']/div[2]/div/div/div/div[1]/input",
locateStrategy: "xpath",
},
methodDescriptionErrorText: {
selector: "span.form-error.has-text-danger",
index: 3,
},
methodClass:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(25) > div > div.field-body > div > div > div > select",
methodClass:{
selector: "//*[@id='methodClass']/div[2]/div/div/div/select",
locateStrategy: "xpath",
},
methodClassErrorText:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(25) > div > div.field-body > div > div > span",
{
selector: "//*[@id='methodClass']/div[2]/div/div/span",
locateStrategy: "xpath",
},
methodText: {
selector: "//div[@class='column is-10 mt-4']",
index: 1,
locateStrategy: "xpath",
},
scaleClass:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(29) > div > div.field-body > div > div > div > select",
scaleClassErrorText:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(29) > div > div.field-body > div > div > span",
scaleClass:{
selector: "//*[@id='scaleClass']/div[2]/div/div/div/select",
locateStrategy: "xpath",
},
scaleClassErrorText: {
selector: "//*[@id='scaleClass']/div[2]/div/div/span",
locateStrategy: "xpath",
},
scaleClassNoOptionsText:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(31) > p",
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(33) > p",
formulaField: "#Formula",
formulaErrorText:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(31) > div > div.field-body > div > div > span",
"form > div.columns.is-multiline.is-gapless.is-vcentered > div:nth-child(33) > div > div.field-body > div > div > span",
unitField: "#Unit",
unitErrorText:
"form > div.columns.is-multiline.is-gapless.is-vcentered > div.column.is-full > div > div.column.new-term.is-10 > div > div.field-body > div > div > span",
Expand Down Expand Up @@ -184,27 +209,27 @@ module.exports = {
ordinalFields: { selector: "div.column.is-2 div.field-body input" },
firstOrdinalField: {
selector:
"div:nth-child(31) div:nth-child(2) div.column.is-2 div.field-body input",
"div:nth-child(33) div:nth-child(2) div.column.is-2 div.field-body input",
},
secondOrdinalField: {
selector:
"div:nth-child(31) div:nth-child(3) div.column.is-2 div.field-body input",
"div:nth-child(33) div:nth-child(3) div.column.is-2 div.field-body input",
},
thirdOrdinalField: {
selector:
"div:nth-child(31) div:nth-child(4) div.column.is-2 div.field-body input",
"div:nth-child(33) div:nth-child(4) div.column.is-2 div.field-body input",
},
fourthOrdinalField: {
selector:
"div:nth-child(31) div:nth-child(5) div.column.is-2 div.field-body input",
"div:nth-child(33) div:nth-child(5) div.column.is-2 div.field-body input",
},
fifthOrdinalField: {
selector:
"div:nth-child(31) div:nth-child(6) div.column.is-2 div.field-body input",
"div:nth-child(33) div:nth-child(6) div.column.is-2 div.field-body input",
},
sixthOrdinalField: {
selector:
"div:nth-child(31) div:nth-child(7) div.column.is-2 div.field-body input",
"div:nth-child(33) div:nth-child(7) div.column.is-2 div.field-body input",
},
firstCategoryField: {
selector: ".//input[@placeholder='Category']",
Expand Down
16 changes: 16 additions & 0 deletions src/step_definitions/ontologySteps.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ Then(
}
);

Then(
/^user can see 'Term Type' dropdown on ontology list page$/,
async () => {
await ontologyPage.section.allTraitsForm.assert.visible("@termType");
}
);

Then(/^user can see 'Save' button on ontology list page$/, async () => {
await ontologyPage.section.allTraitsForm.assert.visible("@saveButton");
});
Expand Down Expand Up @@ -311,6 +318,15 @@ Then(
}
);

When(
/^user selects "([^"]*)" in 'Term Type' dropdown on ontology list page$/,
async (args1) => {
await ontologyPage.section.allTraitsForm.moveToElement("@termType", 1, 1);
await ontologyPage.pause(10000);
await ontologyPage.section.allTraitsForm.setValue("@termType", args1);
}
);

Then(
/^user can see "([^"]*)" below the 'Name' field on ontology list page$/,
async (args1) => {
Expand Down