Skip to content

Loading the same image a second time makes views black #787

@PaulHax

Description

@PaulHax

This test reproduced it

import { volViewPage } from '../pageobjects/volview.page';

describe('Image Reload Bug', () => {
  it('should properly render when loading the same image twice', async () => {
    await volViewPage.open();

    // First click on prostate sample
    await volViewPage.downloadProstateSample();
    await volViewPage.waitForViews();

    const layoutContainer = await $('.layout-container');
    const firstLoadResult = await browser.checkElement(
      layoutContainer,
      'first_load_rendering'
    );

    const THRESHOLD = 11;
    expect(firstLoadResult).toBeLessThan(THRESHOLD);

    // Second click on prostate sample
    // Need to reopen the samples panel first since it closes after selection
    // Look for the Sample Data expansion panel title and click it
    const sampleDataPanelTitle = await $('span=Sample Data').parentElement();
    await sampleDataPanelTitle.click();

    // Wait for the samples list to be visible
    await browser.waitUntil(
      async () => {
        const samplesList = await volViewPage.samplesList;
        return samplesList.isDisplayed();
      },
      {
        timeout: 5000,
        timeoutMsg: 'Expected samples list to be visible after reopening panel',
      }
    );

    // Click prostate sample again
    await volViewPage.downloadProstateSample();

    await volViewPage.waitForViews();

    await browser.pause(2000);

    const secondLoadResult = await browser.checkElement(
      layoutContainer,
      'second_load_rendering'
    );

    expect(secondLoadResult).toBeLessThan(THRESHOLD);
  });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions