Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autotests: #4712 - Set longer timeouts for wait control operations for heavy tests, set propper tags #4714

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -656,15 +656,21 @@ test.describe('Open and Save file', () => {
* Test case: EPMLSOPKET-1852
* Description: The structure is correctly rendered on the canvas
*/
test('Open V3000 mol file contains more than 900 symbols', async ({
page,
}) => {
await openFileAndAddToCanvasAsNewProject(
'Molfiles-V3000/more-900-atoms.mol',
page,
);
await takeEditorScreenshot(page);
});
test(
'Open V3000 mol file contains more than 900 symbols',
{
tag: ['@SlowTest'],
},
async ({ page }) => {
test.slow();

await openFileAndAddToCanvasAsNewProject(
'Molfiles-V3000/more-900-atoms.mol',
page,
);
await takeEditorScreenshot(page);
},
);
});

test.describe('Save file', () => {
Expand Down Expand Up @@ -729,35 +735,41 @@ test.describe('Open and Save file', () => {
}
});

test('Save V3000 mol file contains more than 900 symbols', async ({
page,
}) => {
/**
* Test case: EPMLSOPKET-1859(2)
* Description: v3000 mol file contains more than 900 symbolsis opened and saved correctly
*/
await openFileAndAddToCanvasAsNewProject(
'Molfiles-V3000/more-900-atoms.mol',
page,
);
const expectedFile = await getMolfile(page, 'v3000');
await saveToFile(
'Molfiles-V3000/more-900-atoms-expected.mol',
expectedFile,
);
const METADATA_STRING_INDEX = [1];
test(
'Save V3000 mol file contains more than 900 symbols',
{
tag: ['@SlowTest'],
},
async ({ page }) => {
/**
* Test case: EPMLSOPKET-1859(2)
* Description: v3000 mol file contains more than 900 symbolsis opened and saved correctly
*/
test.slow();

const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
await openFileAndAddToCanvasAsNewProject(
'Molfiles-V3000/more-900-atoms.mol',
page,
expectedFileName:
'tests/test-data/Molfiles-V3000/more-900-atoms-expected.mol',
fileFormat: 'v3000',
metaDataIndexes: METADATA_STRING_INDEX,
});
);
const expectedFile = await getMolfile(page, 'v3000');
await saveToFile(
'Molfiles-V3000/more-900-atoms-expected.mol',
expectedFile,
);
const METADATA_STRING_INDEX = [1];

expect(molFile).toEqual(molFileExpected);
});
const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Molfiles-V3000/more-900-atoms-expected.mol',
fileFormat: 'v3000',
metaDataIndexes: METADATA_STRING_INDEX,
});

expect(molFile).toEqual(molFileExpected);
},
);

test('V3000 mol file contains different Bond properties', async ({
page,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ test.describe('PPTX files', () => {
await takeEditorScreenshot(page);
});

test('User can import canvas with 50 big molecules from .pptx file', async ({
page,
}) => {
/*
test(
'User can import canvas with 50 big molecules from .pptx file',
{
tag: ['@SlowTest'],
},
async ({ page }) => {
/*
Test case: https://github.com/epam/ketcher/issues/4016 - Test case 1
Description: User can import canvas with 50 big molecules from .pptx file
Scenario:
Expand All @@ -42,24 +45,36 @@ test.describe('PPTX files', () => {
5. Press Open as New Project button
6. Validate canvas
*/
await selectTopPanelButton(TopPanelButton.Open, page);
await waitForSpinnerFinishedWork(page, async () => {
await openFile('PPTX/50 mols on 1 canvas.pptx', page);
});
await waitForSpinnerFinishedWork(page, async () => {
await page.getByText('Structure 1', { exact: true }).click();
});
await takeEditorScreenshot(page);
await waitForSpinnerFinishedWork(page, async () => {
await pressButton(page, 'Open as New Project');
});
await takeEditorScreenshot(page);
});
const maxTimeout = 150000;
test.setTimeout(maxTimeout);
const originalTimeout = 10000;
const longerTimeout = 30000;
page.setDefaultTimeout(longerTimeout);

test('User can import from .pptx file with 1000 single molecules @IncorrectResultBecauseOfBug', async ({
page,
}) => {
/*
await selectTopPanelButton(TopPanelButton.Open, page);
await waitForSpinnerFinishedWork(page, async () => {
await openFile('PPTX/50 mols on 1 canvas.pptx', page);
});
await waitForSpinnerFinishedWork(page, async () => {
await page.getByText('Structure 1', { exact: true }).click();
});
await takeEditorScreenshot(page);
await waitForSpinnerFinishedWork(page, async () => {
await pressButton(page, 'Open as New Project');
});
await takeEditorScreenshot(page);

page.setDefaultTimeout(originalTimeout);
},
);

test(
'User can import from .pptx file with 1000 single molecules',
{
tag: ['@SlowTest', '@IncorrectResultBecauseOfBug'],
},
async ({ page }) => {
/*
Test case: https://github.com/epam/ketcher/issues/4016 - Test case 2
Description: User can import from .pptx file with 1000 single molecules
Scenario:
Expand All @@ -71,27 +86,31 @@ test.describe('PPTX files', () => {
6. Validate canvas
IMPORTANT: Result of execution is incorrect because of https://github.com/epam/ketcher/issues/4015 issue.
*/
const maxTimeout = 120000;
test.setTimeout(maxTimeout);
const maxTimeout = 150000;
test.setTimeout(maxTimeout);

await selectTopPanelButton(TopPanelButton.Open, page);
await waitForSpinnerFinishedWork(page, async () => {
await openFile('PPTX/1000 moleculs.pptx', page);
});
await waitForSpinnerFinishedWork(page, async () => {
await page.getByText('Structure 1000', { exact: true }).click();
});
await takeEditorScreenshot(page);
await waitForSpinnerFinishedWork(page, async () => {
await pressButton(page, 'Open as New Project');
});
await takeEditorScreenshot(page);
});
await selectTopPanelButton(TopPanelButton.Open, page);
await waitForSpinnerFinishedWork(page, async () => {
await openFile('PPTX/1000 moleculs.pptx', page);
});
await waitForSpinnerFinishedWork(page, async () => {
await page.getByText('Structure 1000', { exact: true }).click();
});
await takeEditorScreenshot(page);
await waitForSpinnerFinishedWork(page, async () => {
await pressButton(page, 'Open as New Project');
});
await takeEditorScreenshot(page);
},
);

test('User can import from .pptx file with lots of different types of content @IncorrectResultBecauseOfBug', async ({
page,
}) => {
/*
test(
'User can import from .pptx file with lots of different types of content',
{
tag: ['@SlowTest', '@IncorrectResultBecauseOfBug'],
},
async ({ page }) => {
/*
Test case: https://github.com/epam/ketcher/issues/4016 - Test case 3
Description: User can import from .pptx file with lots of different types of content
Scenario:
Expand All @@ -101,26 +120,36 @@ test.describe('PPTX files', () => {
4. Navigate from 10 to 20 Structure in list and Validate every preview area
IMPORTANT: Result of execution is incorrect because of https://github.com/epam/ketcher/issues/4015 issue.
*/
await selectTopPanelButton(TopPanelButton.Open, page);
await waitForSpinnerFinishedWork(page, async () => {
await openFile('PPTX/BigPPT (79 molecules and many objects).pptx', page);
});
for (let count = 10; count <= 20; count++) {
const maxTimeout = 150000;
test.setTimeout(maxTimeout);

await selectTopPanelButton(TopPanelButton.Open, page);
await waitForSpinnerFinishedWork(page, async () => {
await page.getByText(`Structure ${count}`, { exact: true }).click();
await openFile(
'PPTX/BigPPT (79 molecules and many objects).pptx',
page,
);
});
for (let count = 10; count <= 20; count++) {
await waitForSpinnerFinishedWork(page, async () => {
await page.getByText(`Structure ${count}`, { exact: true }).click();
});
await takeEditorScreenshot(page);
}
await waitForSpinnerFinishedWork(page, async () => {
await page.getByText('Structure 79').click();
});
await takeEditorScreenshot(page);
}
await waitForSpinnerFinishedWork(page, async () => {
await page.getByText('Structure 79').click();
});
await takeEditorScreenshot(page);
});
},
);

test('User can import from .pptx file with CDX content containing basic ChemDraw 15.0 object: Arrows @IncorrectResultBecauseOfBug', async ({
page,
}) => {
/*
test(
'User can import from .pptx file with CDX content containing basic ChemDraw 15.0 object: Arrows @IncorrectResultBecauseOfBug',
{
tag: ['@SlowTest', '@IncorrectResultBecauseOfBug'],
},
async ({ page }) => {
/*
Test case: https://github.com/epam/ketcher/issues/4016 - Test case 4
Description: User can import from .pptx file with CDX content containing basic ChemDraw 15.0 object: Arrows
Scenario:
Expand All @@ -134,25 +163,26 @@ test.describe('PPTX files', () => {
IMPORTANT: Result of execution is incorrect because of https://github.com/epam/Indigo/issues/1766 issue.
Update screenshots after fix.
*/
const maxTimeout = 180000;
test.setTimeout(maxTimeout);
const maxTimeout = 210000;
test.setTimeout(maxTimeout);

const structures = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
for await (const count of structures) {
await selectTopPanelButton(TopPanelButton.Open, page);
await waitForSpinnerFinishedWork(page, async () => {
await openFile('PPTX/ARROWS.pptx', page);
});
await waitForSpinnerFinishedWork(page, async () => {
await page.getByText(`Structure ${count}`, { exact: true }).click();
});
await takeEditorScreenshot(page);
await waitForSpinnerFinishedWork(page, async () => {
await pressButton(page, 'Open as New Project');
});
await takeEditorScreenshot(page);
}
});
const structures = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
for await (const count of structures) {
await selectTopPanelButton(TopPanelButton.Open, page);
await waitForSpinnerFinishedWork(page, async () => {
await openFile('PPTX/ARROWS.pptx', page);
});
await waitForSpinnerFinishedWork(page, async () => {
await page.getByText(`Structure ${count}`, { exact: true }).click();
});
await takeEditorScreenshot(page);
await waitForSpinnerFinishedWork(page, async () => {
await pressButton(page, 'Open as New Project');
});
await takeEditorScreenshot(page);
}
},
);

test('User can import from .pptx file with CDX content containing basic ChemDraw 15.0 object: Brackets @IncorrectResultBecauseOfBug', async ({
page,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
clickInTheMiddleOfTheScreen,
waitForPageInit,
pasteFromClipboardAndAddToCanvas,
pasteFromClipboardAndOpenAsNewProject,
} from '@utils';

test.describe('Loading SMARTS files', () => {
Expand All @@ -21,8 +22,7 @@ test.describe('Loading SMARTS files', () => {
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);
await pasteFromClipboardAndOpenAsNewProject(page, smartsStringToPaste);
});

test('Loading SMARTS with aromatic atom list', async ({ page }) => {
Expand Down
Loading
Loading