-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autotests: #5558 - Add ambiguous monomers to the library and allow th…
…eir addition to the canvas - Case 8
- Loading branch information
1 parent
9e7a464
commit 56cf615
Showing
24 changed files
with
229 additions
and
48 deletions.
There are no files selected for viewing
156 changes: 156 additions & 0 deletions
156
...sts/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.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,156 @@ | ||
import { test } from '@playwright/test'; | ||
import { | ||
waitForPageInit, | ||
Bases, | ||
Peptides, | ||
selectMonomer, | ||
takeEditorScreenshot, | ||
clickOnTheCanvas, | ||
} from '@utils'; | ||
import { turnOnMacromoleculesEditor } from '@utils/macromolecules'; | ||
import { goToRNATab, MonomerLocationTabs } from '@utils/macromolecules/library'; | ||
|
||
interface IAmbiguousMonomerName { | ||
testDescription: string; | ||
AmbiguousMonomerName: Peptides | Bases; | ||
MonomerLocationTab: MonomerLocationTabs; | ||
// Set shouldFail to true if you expect test to fail because of existed bug and put issues link to issueNumber | ||
shouldFail?: boolean; | ||
// issueNumber is mandatory if shouldFail === true | ||
issueNumber?: string; | ||
// set pageReloadNeeded to true if you need to restart ketcher before test (f.ex. to restart font renderer) | ||
pageReloadNeeded?: boolean; | ||
} | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await waitForPageInit(page); | ||
await turnOnMacromoleculesEditor(page); | ||
}); | ||
|
||
const AmbiguousMonomers: IAmbiguousMonomerName[] = [ | ||
{ | ||
testDescription: "1. 'X' ambiguous peptide", | ||
AmbiguousMonomerName: Peptides.X, | ||
MonomerLocationTab: MonomerLocationTabs.PEPTIDES, | ||
}, | ||
{ | ||
testDescription: "2. 'B' ambiguous peptide", | ||
AmbiguousMonomerName: Peptides.B, | ||
MonomerLocationTab: MonomerLocationTabs.PEPTIDES, | ||
}, | ||
{ | ||
testDescription: "3. 'J' ambiguous peptide", | ||
AmbiguousMonomerName: Peptides.J, | ||
MonomerLocationTab: MonomerLocationTabs.PEPTIDES, | ||
}, | ||
{ | ||
testDescription: "4. 'Z' ambiguous peptide", | ||
AmbiguousMonomerName: Peptides.Z, | ||
MonomerLocationTab: MonomerLocationTabs.PEPTIDES, | ||
}, | ||
{ | ||
testDescription: "5. 'N' ambiguous DNA base", | ||
AmbiguousMonomerName: Bases.DNA_N, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "6. 'B' ambiguous DNA base", | ||
AmbiguousMonomerName: Bases.DNA_B, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "7. 'H' ambiguous DNA base", | ||
AmbiguousMonomerName: Bases.DNA_H, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "8. 'K' ambiguous DNA base", | ||
AmbiguousMonomerName: Bases.DNA_K, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "9. 'W' ambiguous DNA base", | ||
AmbiguousMonomerName: Bases.DNA_W, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "10. 'Y' ambiguous DNA base", | ||
AmbiguousMonomerName: Bases.DNA_Y, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "11. 'N' ambiguous RNA base", | ||
AmbiguousMonomerName: Bases.RNA_N, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "12. 'B' ambiguous RNA base", | ||
AmbiguousMonomerName: Bases.RNA_B, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "13. 'H' ambiguous RNA base", | ||
AmbiguousMonomerName: Bases.RNA_H, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "14. 'K' ambiguous RNA base", | ||
AmbiguousMonomerName: Bases.RNA_K, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "15. 'W' ambiguous RNA base", | ||
AmbiguousMonomerName: Bases.RNA_W, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "16. 'Y' ambiguous RNA base", | ||
AmbiguousMonomerName: Bases.RNA_Y, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "17. 'M' ambiguous base", | ||
AmbiguousMonomerName: Bases.M, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "18. 'R' ambiguous base", | ||
AmbiguousMonomerName: Bases.R, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "19. 'S' ambiguous base", | ||
AmbiguousMonomerName: Bases.S, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
{ | ||
testDescription: "20. 'V' ambiguous base", | ||
AmbiguousMonomerName: Bases.V, | ||
MonomerLocationTab: MonomerLocationTabs.BASES, | ||
}, | ||
]; | ||
|
||
test.describe('Put ambiguous monomer on the canvas from library:', () => { | ||
for (const AmbiguousMonomer of AmbiguousMonomers) { | ||
test(`${AmbiguousMonomer.testDescription}`, async ({ page }) => { | ||
/* | ||
Test task: https://github.com/epam/ketcher/issues/5558 | ||
8. Verify the addition of ambuguous monomers to the canvas | ||
Case: | ||
1. Find monomer at the library and click on it | ||
2. Click at the center of canvas | ||
3. Take screenshot of the canvas to make sure selected monomer appeared on the canvas | ||
*/ | ||
await goToRNATab(page); | ||
await selectMonomer(page, AmbiguousMonomer.AmbiguousMonomerName); | ||
await clickOnTheCanvas(page, 0, 0); | ||
await takeEditorScreenshot(page); | ||
|
||
// Test should be skipped if related bug exists | ||
test.fixme( | ||
AmbiguousMonomer.shouldFail === true, | ||
`That test fails because of ${AmbiguousMonomer.issueNumber} issue.`, | ||
); | ||
}); | ||
} | ||
}); |
Binary file added
BIN
+10.5 KB
...s-monomer-on-the-canvas-from-library-1-X-ambiguous-peptide-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
+10 KB
...monomer-on-the-canvas-from-library-10-Y-ambiguous-DNA-base-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
+9.01 KB
...monomer-on-the-canvas-from-library-11-N-ambiguous-RNA-base-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
+10.9 KB
...monomer-on-the-canvas-from-library-12-B-ambiguous-RNA-base-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
+10.9 KB
...monomer-on-the-canvas-from-library-13-H-ambiguous-RNA-base-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
+9.51 KB
...monomer-on-the-canvas-from-library-14-K-ambiguous-RNA-base-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
+9.52 KB
...monomer-on-the-canvas-from-library-15-W-ambiguous-RNA-base-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
+9.78 KB
...monomer-on-the-canvas-from-library-16-Y-ambiguous-RNA-base-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
+10.2 KB
...ous-monomer-on-the-canvas-from-library-17-M-ambiguous-base-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
+9.96 KB
...ous-monomer-on-the-canvas-from-library-18-R-ambiguous-base-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
+10.3 KB
...ous-monomer-on-the-canvas-from-library-19-S-ambiguous-base-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
+12.1 KB
...s-monomer-on-the-canvas-from-library-2-B-ambiguous-peptide-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
+11.4 KB
...ous-monomer-on-the-canvas-from-library-20-V-ambiguous-base-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
+10.6 KB
...s-monomer-on-the-canvas-from-library-3-J-ambiguous-peptide-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
+11.5 KB
...s-monomer-on-the-canvas-from-library-4-Z-ambiguous-peptide-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
+9.02 KB
...-monomer-on-the-canvas-from-library-5-N-ambiguous-DNA-base-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
+11.2 KB
...-monomer-on-the-canvas-from-library-6-B-ambiguous-DNA-base-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
+11.1 KB
...-monomer-on-the-canvas-from-library-7-H-ambiguous-DNA-base-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
+9.79 KB
...-monomer-on-the-canvas-from-library-8-K-ambiguous-DNA-base-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
+9.8 KB
...-monomer-on-the-canvas-from-library-9-W-ambiguous-DNA-base-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.
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
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
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