-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autotests: #3581 - add tests for missed test cases based on done tick…
…ets for smarts (#3710) * adding test for checking pasting as SMARTS feature * adding few tests for visual check * adding screenshots for tests from visual-check spec * adding tests for checking warnings - covering with test cases ticket number 3431 * adding tests to cover ticket 3459 and 3445 * removing unnecessary import * adding tests to cover ticket 3397 and 3408 * removing unnecessary import * adding tests to cover 3387, 3372, 3362 and 3340 * adding tests to cover ticket 3339 * adding tests to cover tickets 3338 and 3328 * adding tests to cover indigo issues 1358, 1332, 1321, 1316, 1281 and 1252 * - code refactoring * - working on comments; - added 2 expected snapshots * - code refactoring * - change name of function * - code refactoring --------- Co-authored-by: Urszula Gawlowska <urszula.gawlowska@epam.com> Co-authored-by: Zhirnoff <mikhail_zhirnov@epam.com>
- Loading branch information
1 parent
c981241
commit 978d8ed
Showing
39 changed files
with
847 additions
and
3 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
+8.92 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
+9.39 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.
38 changes: 38 additions & 0 deletions
38
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,38 @@ | ||
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) | ||
Screenshot for this test is incorrect since Indigo issue #1332 still occurs when test is running locally | ||
*/ | ||
const smartsStringToPaste = 'c1-[#6]=[#6]-[#6]=[#6]-[c,n]=1'; | ||
await pasteFromClipboardAndAddToCanvas(page, smartsStringToPaste, false); | ||
await clickInTheMiddleOfTheScreen(page); | ||
}); | ||
}); |
Binary file added
BIN
+8.16 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.54 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.
90 changes: 90 additions & 0 deletions
90
...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,90 @@ | ||
import { Page, test } from '@playwright/test'; | ||
import { | ||
BondTypeName, | ||
clickInTheMiddleOfTheScreen, | ||
doubleClickOnAtom, | ||
pressButton, | ||
selectBond, | ||
takeEditorScreenshot, | ||
waitForAtomPropsModal, | ||
waitForPageInit, | ||
} from '@utils'; | ||
import { | ||
checkSmartsValue, | ||
checkSmartsWarnings, | ||
setReactionFlagExactChange, | ||
setReactionFlagInversion, | ||
} from '../utils'; | ||
|
||
const defaultFileFormat = 'MDL Molfile V2000'; | ||
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, defaultFileFormat, 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, defaultFileFormat, 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, defaultFileFormat, 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.