Skip to content

Commit

Permalink
Autotests: #3359 File management - open and save files (#3365)
Browse files Browse the repository at this point in the history
* added tests&scrshots

* minor upd

* updated mask&scrshot

* minor upd

* deleted comment
  • Loading branch information
y-holik authored Sep 29, 2023
1 parent e11818d commit f8c04df
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { test, expect } from '@playwright/test';
import {
TopPanelButton,
selectTopPanelButton,
takeEditorScreenshot,
waitForPageInit,
} from '@utils';

test.describe('Open Ketcher', () => {
test.beforeEach(async ({ page }) => {
await waitForPageInit(page);
});

test('Open button tooltip', async ({ page }) => {
// Test case: EPMLSOPKET-1833
const button = page.getByTestId('open-file-button');
await expect(button).toHaveAttribute('title', 'Open... (Ctrl+O)');
});

test('Open button UI', async ({ page }) => {
// Test case: EPMLSOPKET-1834
await selectTopPanelButton(TopPanelButton.Open, page);
await takeEditorScreenshot(page);
});

test('Save button tooltip', async ({ page }) => {
// Test case: EPMLSOPKET-1842
const button = page.getByTestId('save-file-button');
await expect(button).toHaveAttribute('title', 'Save as... (Ctrl+S)');
});

test('Save button UI', async ({ page }) => {
// Test case: EPMLSOPKET-1843
await selectTopPanelButton(TopPanelButton.Save, page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('mol-preview-area-text')],
});
});

const fileFormats = [
'Ket Format-option',
'MDL Molfile V2000-option',
'MDL Molfile V3000-option',
'SDF V2000-option',
'SDF V3000-option',
'Daylight SMARTS-option',
'Extended SMILES-option',
'CML-option',
'InChI-option',
'InChI AuxInfo-option',
'InChIKey-option',
'SVG Document-option',
'PNG Image-option',
'CDXML-option',
'Base64 CDX-option',
'CDX-option',
];
for (const fileFormat of fileFormats) {
test(`dropdown options check_${fileFormat}`, async ({ page }) => {
await selectTopPanelButton(TopPanelButton.Save, page);
await page.getByRole('button', { name: 'MDL Molfile V2000' }).click();
const option = page.getByTestId(fileFormat);
await expect(option).toBeVisible();
});
}
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f8c04df

Please sign in to comment.