-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from Exabyte-io/feature/SOF-4598
Feature/sof 4598
- Loading branch information
Showing
10 changed files
with
223 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
tests/cucumber/features/3d-editor/multiple-selection-cancel.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Feature: User can cancel active multiple selection and all changes should be reverted | ||
|
||
Scenario: | ||
When I open materials designer page | ||
And I create materials with the following data | ||
| name | basis | | ||
| supercell | Si 0 0 0;Si 0 0 0 | | ||
And I open multi-material 3D editor | ||
|
||
# set default positions for easier expectations calculations | ||
And I toggle scene object "supercell" opener inside 3D editor | ||
And I toggle scene object "Atoms" opener inside 3D editor | ||
And I select scene object "Si-0" inside 3D editor | ||
And I set position of scene object with the following data: | ||
| x | y | z | | ||
| -1.0 | -1.0 | -1.0 | | ||
And I select scene object "Si-1" inside 3D editor | ||
And I set position of scene object with the following data: | ||
| x | y | z | | ||
| 1.0 | 1.0 | 1.0 | | ||
|
||
# select atoms and move them a bit | ||
And I click on "Toggle Multiple Selection" toolbar button | ||
And I make multiple-selection with the following coordinates: | ||
| x1 | y1 | x2 | y2 | | ||
| $FLOAT{-0.5} | $FLOAT{-0.5} | $FLOAT{0.5} | $FLOAT{0.5} | | ||
And I set position of scene object with the following data: | ||
| x | y | z | | ||
| 1.0 | 1.0 | 1.0 | | ||
|
||
# cancel multiple selection | ||
And I click on "Cancel Multiple Selection" toolbar button | ||
|
||
# expect that atoms have initial positions and weren't changed | ||
And I select scene object "Si-0" inside 3D editor | ||
Then I see that scene object has the following position: | ||
| x | y | z | | ||
| $FLOAT{-1.0} | $FLOAT{-1.0} | $FLOAT{-1.0} | | ||
And I select scene object "Si-1" inside 3D editor | ||
Then I see that scene object has the following position: | ||
| x | y | z | | ||
| $FLOAT{1.0} | $FLOAT{1.0} | $FLOAT{1.0} | |
42 changes: 42 additions & 0 deletions
42
tests/cucumber/features/3d-editor/multiple-selection-submit.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Feature: User can select multiple atoms, move them and update their positions accordingly | ||
|
||
Scenario: | ||
When I open materials designer page | ||
And I create materials with the following data | ||
| name | basis | | ||
| supercell | Si 0 0 0;Si 0 0 0 | | ||
And I open multi-material 3D editor | ||
|
||
# set default positions for easier expectations calculations | ||
And I toggle scene object "supercell" opener inside 3D editor | ||
And I toggle scene object "Atoms" opener inside 3D editor | ||
And I select scene object "Si-0" inside 3D editor | ||
And I set position of scene object with the following data: | ||
| x | y | z | | ||
| -1.0 | -1.0 | -1.0 | | ||
And I select scene object "Si-1" inside 3D editor | ||
And I set position of scene object with the following data: | ||
| x | y | z | | ||
| 1.0 | 1.0 | 1.0 | | ||
|
||
# select atoms and move them a bit | ||
And I click on "Toggle Multiple Selection" toolbar button | ||
And I make multiple-selection with the following coordinates: | ||
| x1 | y1 | x2 | y2 | | ||
| $FLOAT{-0.5} | $FLOAT{-0.5} | $FLOAT{0.5} | $FLOAT{0.5} | | ||
And I set position of scene object with the following data: | ||
| x | y | z | | ||
| 1.0 | 1.0 | 1.0 | | ||
|
||
# submit multiple selection | ||
And I click on "Submit Multiple Selection" toolbar button | ||
|
||
# expect that atoms' positions were changed | ||
And I select scene object "Si-0" inside 3D editor | ||
Then I see that scene object has the following position: | ||
| x | y | z | | ||
| $FLOAT{0.0} | $FLOAT{0.0} | $FLOAT{0.0} | | ||
And I select scene object "Si-1" inside 3D editor | ||
Then I see that scene object has the following position: | ||
| x | y | z | | ||
| $FLOAT{2.0} | $FLOAT{2.0} | $FLOAT{2.0} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...umber/support/step_definitions/Then I see that scene object has the following position.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import assert from "assert"; | ||
import isEqual from "lodash/isEqual"; | ||
import {parseTable} from "../utils/table"; | ||
import {materialDesignerPage} from "../widgets/material_designer_page"; | ||
|
||
export default function () { | ||
this.Then(/^I see that scene object has the following position:$/, function (table) { | ||
const config = parseTable(table, this)[0]; | ||
const expectedPosition = [config.x, config.y, config.z]; | ||
const sceneObjectPosition = | ||
materialDesignerPage.designerWidget.threeJSEditorWidget.getSceneObjectPosition(); | ||
|
||
assert(isEqual(sceneObjectPosition, expectedPosition)); | ||
}); | ||
} |
7 changes: 7 additions & 0 deletions
7
tests/cucumber/support/step_definitions/When I click on # toolbar button.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {materialDesignerPage} from "../widgets/material_designer_page"; | ||
|
||
export default function () { | ||
this.Then(/^I click on "([^"]*)" toolbar button$/, function (title) { | ||
materialDesignerPage.designerWidget.threeJSEditorWidget.clickOnToolbarButton(title); | ||
}); | ||
} |
9 changes: 9 additions & 0 deletions
9
...support/step_definitions/When I make multiple-selection with the following coordinates.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {parseTable} from "../utils/table"; | ||
import {materialDesignerPage} from "../widgets/material_designer_page"; | ||
|
||
export default function () { | ||
this.When(/^I make multiple-selection with the following coordinates:$/, function (table) { | ||
const coordinates = parseTable(table, this)[0]; | ||
materialDesignerPage.designerWidget.threeJSEditorWidget.makeMultipleSelection(coordinates); | ||
}); | ||
} |
7 changes: 7 additions & 0 deletions
7
...cucumber/support/step_definitions/When I toggle scene object # opener inside 3D editor.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {materialDesignerPage} from "../widgets/material_designer_page"; | ||
|
||
export default function () { | ||
this.When(/^I toggle scene object "([^"]*)" opener inside 3D editor$/, function (sceneObjectName) { | ||
materialDesignerPage.designerWidget.threeJSEditorWidget.toggleSceneObjectOpener(sceneObjectName); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters