-
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.
Browse files
Browse the repository at this point in the history
- add tests for missed test cases based on done tickets for smarts (#3710) Co-authored-by: Urszula Gawlowska <[email protected]>
- Loading branch information
Showing
41 changed files
with
853 additions
and
5 deletions.
There are no files selected for viewing
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
Binary file added
BIN
+9.48 KB
...ith-different-formats-Open-ket-file-with-SMARTS-attributes-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
Binary file added
BIN
+11.5 KB
...ste-files-Save-ket-file-with-atom-list-and-atom-properties-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.
37 changes: 37 additions & 0 deletions
37
ketcher-autotests/tests/File-Management/SMARTS-Files/smarts-files.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,37 @@ | ||
import { test } from '@playwright/test'; | ||
import { | ||
takeEditorScreenshot, | ||
clickInTheMiddleOfTheScreen, | ||
waitForPageInit, | ||
pasteFromClipboardAndAddToCanvas, | ||
} from '@utils'; | ||
|
||
test.describe('Loading SMARTS files', () => { | ||
test.beforeEach(async ({ page }) => { | ||
await waitForPageInit(page); | ||
}); | ||
|
||
test.afterEach(async ({ page }) => { | ||
await takeEditorScreenshot(page); | ||
}); | ||
|
||
test('Loading SMARTS with custom query', async ({ page }) => { | ||
/* | ||
Test case: https://github.com/epam/Indigo/issues/1358 | ||
Description: [!#6,!#7,!#8] should be loaded as custom query without any error | ||
*/ | ||
const smartsStringToPaste = '[!#6,!#7,!#8]'; | ||
await pasteFromClipboardAndAddToCanvas(page, smartsStringToPaste, false); | ||
await clickInTheMiddleOfTheScreen(page); | ||
}); | ||
|
||
test('Loading SMARTS with aromatic atom list', async ({ page }) => { | ||
/* | ||
Test case: https://github.com/epam/Indigo/issues/1332 | ||
Description: c1-[#6]=[#6]-[#6]=[#6]-[c,n]=1 should be loaded as benzene with aromatic atom list (carbon and nitrogen) | ||
*/ | ||
const smartsStringToPaste = 'c1-[#6]=[#6]-[#6]=[#6]-[c,n]=1'; | ||
await pasteFromClipboardAndAddToCanvas(page, smartsStringToPaste, false); | ||
await clickInTheMiddleOfTheScreen(page); | ||
}); | ||
}); |
Binary file added
BIN
+8.92 KB
...oading-SMARTS-files-Loading-SMARTS-with-aromatic-atom-list-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.8 KB
...hots/Loading-SMARTS-files-Loading-SMARTS-with-custom-query-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
Binary file added
BIN
+38.4 KB
...ts/Atom-Properties-Add-incorrect-negative-Isotope-in-modal-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
+33.3 KB
...pec.ts-snapshots/Atom-Properties-Dialog---Atom-type---List-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
+35.3 KB
....ts-snapshots/Atom-Properties-Dialog---Atom-type---Special-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
+39.4 KB
...erties-Type-in-the-Charge-field-number-bigger-than-maximum-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
+25.6 KB
...to-custom--47250-nverting-Type-Single-down-to-custom-query-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
+25.5 KB
...to-custom--57793-acting-Center-Made-broken-to-custom-query-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
+25.6 KB
...to-custom--a38d7-ting-Center-Order-changes-to-custom-query-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
+25.5 KB
...to-custom--a55db-nd-Reacting-Center-Center-to-custom-query-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
+26.3 KB
...tes-to-custom--add85--Ring-and-Type-Double-to-custom-query-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
+26.6 KB
...es-to-custom--e2561--Chain-and-Type-Triple-to-custom-query-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.
87 changes: 87 additions & 0 deletions
87
...g-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.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,87 @@ | ||
import { Page, test } from '@playwright/test'; | ||
import { | ||
BondTypeName, | ||
checkSmartsValue, | ||
checkSmartsWarnings, | ||
clickInTheMiddleOfTheScreen, | ||
doubleClickOnAtom, | ||
pressButton, | ||
selectBond, | ||
setReactionFlagExactChange, | ||
setReactionFlagInversion, | ||
takeEditorScreenshot, | ||
waitForAtomPropsModal, | ||
waitForPageInit, | ||
} from '@utils'; | ||
|
||
const expectedSmarts = '[#6](-[#6])(-[#6])-[#6]'; | ||
|
||
async function drawStructure(page: Page, numberOfClicks: number) { | ||
await selectBond(BondTypeName.Single, page); | ||
for (let i = 0; i < numberOfClicks; i++) { | ||
await clickInTheMiddleOfTheScreen(page); | ||
} | ||
} | ||
|
||
async function drawStructureAndDoubleClickOnAtom( | ||
page: Page, | ||
numberOfBondsAtStructure: number, | ||
atomType: string, | ||
numberOfAtom: number, | ||
) { | ||
await waitForPageInit(page); | ||
await drawStructure(page, numberOfBondsAtStructure); | ||
await page.keyboard.press('Escape'); | ||
await doubleClickOnAtom(page, atomType, numberOfAtom); | ||
await waitForAtomPropsModal(page); | ||
} | ||
|
||
test.describe('Checking atom properties attributes in SMARTS format', () => { | ||
test.beforeEach(async ({ page }) => { | ||
const numberOfAtom = 0; | ||
const numberOfBondsAtStructure = 3; | ||
await drawStructureAndDoubleClickOnAtom( | ||
page, | ||
numberOfBondsAtStructure, | ||
'C', | ||
numberOfAtom, | ||
); | ||
await page.getByTestId('Reaction flags-section').click(); | ||
}); | ||
|
||
test('Setting reaction flag - Inverts', async ({ page }) => { | ||
/** | ||
* Test case: https://github.com/epam/ketcher/issues/3431 | ||
* Description: setting reaction flag - inverts should have no impact on SMARTS output but warning should be displayed | ||
*/ | ||
await setReactionFlagInversion(page, 'Inverts'); | ||
await pressButton(page, 'Apply'); | ||
await takeEditorScreenshot(page); | ||
await checkSmartsValue(page, expectedSmarts); | ||
await checkSmartsWarnings(page); | ||
}); | ||
|
||
test('Setting reaction flag - Retains', async ({ page }) => { | ||
/** | ||
* Test case: https://github.com/epam/ketcher/issues/3431 | ||
* Description: setting reaction flag - retains should have no impact on SMARTS output but warning should be displayed | ||
*/ | ||
await setReactionFlagInversion(page, 'Retains'); | ||
await pressButton(page, 'Apply'); | ||
await takeEditorScreenshot(page); | ||
await checkSmartsValue(page, expectedSmarts); | ||
await checkSmartsWarnings(page); | ||
}); | ||
|
||
test('Setting reaction flag - Exact change checked', async ({ page }) => { | ||
/** | ||
* Test case: https://github.com/epam/ketcher/issues/3431 | ||
* Description: checking exact change option at reaction flag section should have no impact on SMARTS output but warning should be displayed | ||
*/ | ||
await setReactionFlagExactChange(page); | ||
await pressButton(page, 'Apply'); | ||
await takeEditorScreenshot(page); | ||
await checkSmartsValue(page, expectedSmarts); | ||
await checkSmartsWarnings(page); | ||
}); | ||
}); |
Binary file added
BIN
+9.39 KB
...SMARTS-format-Setting-reaction-flag---Exact-change-checked-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.22 KB
...ttributes-in-SMARTS-format-Setting-reaction-flag---Inverts-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.37 KB
...ttributes-in-SMARTS-format-Setting-reaction-flag---Retains-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.62 KB
...ng-S-Group-as-SMARTS-Checking-SMARTS-with-two-query-groups-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
+6.42 KB
...ng-S-Group-as-SMARTS-Checking-SMARTS-with-two-query-groups-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.
Oops, something went wrong.