Skip to content

Commit

Permalink
test: wait for the structure dialog to be visible and hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed Jan 8, 2025
1 parent f1ee5b8 commit c9e3036
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion test-e2e/panels/structures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ test('should draw structure and display it with MF', async ({ page }) => {
await test.step('Add ring molecule', async () => {
// Click on the "Add Molecule" button.
await nmrium.clickToolByTitle('Add molecule');
await nmrium.page
.locator('div[role="dialog"]')
.waitFor({ state: 'visible' });

// Select the "ring" tool.
await nmrium.page.click('canvas >> nth=0', {
Expand Down Expand Up @@ -57,6 +60,9 @@ test('should draw structure and display it with MF', async ({ page }) => {
await test.step('Add a second molecule and check the visibility', async () => {
// Click on the "Add Molecule" button.
await nmrium.clickToolByTitle('Add molecule');
await nmrium.page
.locator('div[role="dialog"]')
.waitFor({ state: 'visible' });

// Select the "aromatic ring" tool.
await nmrium.page.click('canvas >> nth=0', {
Expand All @@ -74,6 +80,9 @@ test('should draw structure and display it with MF', async ({ page }) => {
});
// Save the molecule.
await nmrium.page.click('button >> text=Save');
await nmrium.page
.locator('div[role="dialog"]')
.waitFor({ state: 'hidden' });

// Check the visibility.

Expand Down Expand Up @@ -143,6 +152,9 @@ test('molecules 1H spectrum', async ({ page, browserName }) => {
await test.step('Add ring molecule and check the visibility', async () => {
// Click on the "Add Molecule" button.
await nmrium.clickToolByTitle('Add molecule');
await nmrium.page
.locator('div[role="dialog"]')
.waitFor({ state: 'visible' });

// Select the "ring" tool.
await nmrium.page.click('canvas >> nth=0', {
Expand All @@ -160,6 +172,9 @@ test('molecules 1H spectrum', async ({ page, browserName }) => {
});
// Save the molecule.
await nmrium.page.click('button >> text=Save');
await nmrium.page
.locator('div[role="dialog"]')
.waitFor({ state: 'hidden' });

// Check the visibility.

Expand All @@ -183,7 +198,9 @@ test('molecules 1H spectrum', async ({ page, browserName }) => {
await test.step('Add a third molecule and check the visibility', async () => {
// Click on the "Add Molecule" button.
await nmrium.clickToolByTitle('Add molecule');

await nmrium.page
.locator('div[role="dialog"]')
.waitFor({ state: 'visible' });
// Select the "aromatic ring" tool.
await nmrium.page.click('canvas >> nth=0', {
position: {
Expand All @@ -200,6 +217,9 @@ test('molecules 1H spectrum', async ({ page, browserName }) => {
});
// Save the molecule.
await nmrium.page.click('button >> text=Save');
await nmrium.page
.locator('div[role="dialog"]')
.waitFor({ state: 'hidden' });

// Check the visibility.

Expand Down

0 comments on commit c9e3036

Please sign in to comment.