-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3824 - Macro: Modify nucleotides from sequence in RNA builder
- Loading branch information
1 parent
c257c83
commit 3b963d7
Showing
59 changed files
with
3,624 additions
and
164 deletions.
There are no files selected for viewing
105 changes: 105 additions & 0 deletions
105
...otests/tests/Macromolecule-editor/Sequence-Mode/sequence-mode-edit-in-rna-builder.spec.ts
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,105 @@ | ||
import { test } from '@playwright/test'; | ||
import { | ||
takeEditorScreenshot, | ||
waitForPageInit, | ||
openFileAndAddToCanvasMacro, | ||
selectSequenceLayoutModeTool, | ||
takeRNABuilderScreenshot, | ||
takeMonomerLibraryScreenshot, | ||
moveMouseAway, | ||
takePageScreenshot, | ||
selectRectangleArea, | ||
} from '@utils'; | ||
import { turnOnMacromoleculesEditor } from '@utils/macromolecules'; | ||
import { PHOSPHATE, SUGAR } from '@constants/testIdConstants'; | ||
|
||
test.describe('Sequence mode edit in RNA Builder', () => { | ||
test.beforeEach(async ({ page }) => { | ||
await waitForPageInit(page); | ||
await turnOnMacromoleculesEditor(page); | ||
|
||
await openFileAndAddToCanvasMacro('KET/nine-connected-rnas.ket', page); | ||
await selectSequenceLayoutModeTool(page); | ||
}); | ||
|
||
test('Select one nucleotide and modify sugar', async ({ page }) => { | ||
await page.getByText('T').first().click(); | ||
await page.getByText('T').first().click({ button: 'right' }); | ||
// should see correct context menu title and available 'modify_in_rna_builder' button | ||
await takeEditorScreenshot(page); | ||
await page.getByTestId('modify_in_rna_builder').click(); | ||
// should see uploaded nucleotide data to RNA Builder and disabled "Update" button | ||
// should see disabled top bar's selectors | ||
await takePageScreenshot(page); | ||
await page.getByTestId(SUGAR).click(); | ||
// should see disabled and nondisabled sugars | ||
await takeMonomerLibraryScreenshot(page); | ||
await page.getByTestId('25R___2,5-Ribose').click(); | ||
await moveMouseAway(page); | ||
// should see updated sugar, updated title of preset and nondisabled "Update" button | ||
await takeRNABuilderScreenshot(page); | ||
await page.getByTestId('save-btn').click(); | ||
// should see updated nucleotide in chain | ||
// should see nondisabled top bar's selectors | ||
await takePageScreenshot(page); | ||
}); | ||
|
||
test('Select one nucleotide and cancel modification', async ({ page }) => { | ||
await page.getByText('T').first().click(); | ||
await page.getByText('T').first().click({ button: 'right' }); | ||
await page.getByTestId('modify_in_rna_builder').click(); | ||
await page.getByTestId(SUGAR).click(); | ||
await page.getByTestId('25R___2,5-Ribose').click(); | ||
await moveMouseAway(page); | ||
// should see updated sugar, updated title of preset and nondisabled "Update" button | ||
await takeRNABuilderScreenshot(page); | ||
await page.getByTestId('cancel-btn').click(); | ||
// should see not updated nucleotide in chain | ||
await takeEditorScreenshot(page); | ||
}); | ||
|
||
test('Select two nucleotides and modify sugar and phosphate', async ({ | ||
page, | ||
}) => { | ||
// Coordinates for rectangle selection | ||
const startX = 100; | ||
const startY = 100; | ||
const endX = 200; | ||
const endY = 200; | ||
await selectRectangleArea(page, startX, startY, endX, endY); | ||
await takeEditorScreenshot(page); | ||
await page.getByText('T').first().click({ button: 'right' }); | ||
// should see correct context menu title and available 'modify_in_rna_builder' button | ||
await takeEditorScreenshot(page); | ||
await page.getByTestId('modify_in_rna_builder').click(); | ||
// should see uploaded nucleotides data to RNA Builder and disabled "Update" button | ||
await takeRNABuilderScreenshot(page); | ||
await page.getByTestId(SUGAR).click(); | ||
await page.getByTestId('25R___2,5-Ribose').click(); | ||
await moveMouseAway(page); | ||
await page.getByTestId(PHOSPHATE).click(); | ||
await page.getByTestId('bP___Boranophosphate').click(); | ||
await moveMouseAway(page); | ||
// should see updated sugar and phosphate, and nondisabled "Update" button | ||
await takeRNABuilderScreenshot(page); | ||
await page.getByTestId('save-btn').click(); | ||
// should see modal to apply or cancel modification | ||
await takeEditorScreenshot(page); | ||
await page.getByText('Yes').click(); | ||
// should see updated nucleotides in chain | ||
await takeEditorScreenshot(page); | ||
}); | ||
|
||
test('Select entire chain and see disabled modify_in_rna_builder button', async ({ | ||
page, | ||
}) => { | ||
await page.keyboard.down('Control'); | ||
await page.getByText('T').first().click(); | ||
await page.keyboard.up('Control'); | ||
// should see the whole chain selected | ||
await takeEditorScreenshot(page); | ||
await page.getByText('T').first().click({ button: 'right' }); | ||
// should see correct context menu title and disabled 'modify_in_rna_builder' button | ||
await takeEditorScreenshot(page); | ||
}); | ||
}); |
Binary file added
BIN
+9.73 KB
...-entir-0092b-and-see-disabled-modify-in-rna-builder-button-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.4 KB
...-entir-f3387-and-see-disabled-modify-in-rna-builder-button-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.02 KB
...-RNA-Builder-Select-one-nucleotide-and-cancel-modification-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.85 KB
...-RNA-Builder-Select-one-nucleotide-and-cancel-modification-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.1 KB
...edit-in-RNA-Builder-Select-one-nucleotide-and-modify-sugar-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.4 KB
...edit-in-RNA-Builder-Select-one-nucleotide-and-modify-sugar-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+30.4 KB
...edit-in-RNA-Builder-Select-one-nucleotide-and-modify-sugar-3-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.03 KB
...edit-in-RNA-Builder-Select-one-nucleotide-and-modify-sugar-4-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.4 KB
...edit-in-RNA-Builder-Select-one-nucleotide-and-modify-sugar-5-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.6 KB
...lder-Select-two-nucleotides-and-modify-sugar-and-phosphate-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.3 KB
...lder-Select-two-nucleotides-and-modify-sugar-and-phosphate-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.5 KB
...lder-Select-two-nucleotides-and-modify-sugar-and-phosphate-3-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.2 KB
...lder-Select-two-nucleotides-and-modify-sugar-and-phosphate-4-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.8 KB
...lder-Select-two-nucleotides-and-modify-sugar-and-phosphate-5-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.14 KB
...lder-Select-two-nucleotides-and-modify-sugar-and-phosphate-6-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.