Skip to content

Update e2e tests to take more screenshots #16715

@brandyscarney

Description

@brandyscarney

Feature Request

Ionic version:

[x] 4.x

Describe the Feature Request
Update our e2e tests (specifically overlay components) to take screenshots of more examples.

Describe Preferred Solution
The action sheet splits all of the tests into multiple files:

screen shot 2018-12-12 at 5 53 17 pm

However, alert loops through each button id to take the screenshots:

test('alert: basic', async () => {
  const page = await newE2EPage({
    url: '/src/components/alert/test/basic?ionic:_testing=true'
  });

  const alerts = [
    ['#basic'],
    ['#longMessage', 'long message'],
    ['#multipleButtons', 'multiple buttons'],
    ['#noMessage', 'no message'],
    ['#confirm', 'confirm'],
    ['#prompt', 'prompt'],
    ['#radio', 'radio'],
    ['#checkbox', 'checkbox']
  ];

  for (const [buttonSelector, message] of alerts) {
    await page.click(buttonSelector);

    const alert = await page.find('ion-alert');
    expect(alert).not.toBe(null);
    await alert.waitForVisible();
    await page.waitFor(250);

    const compare = await page.compareScreenshot(message);
    expect(compare).toMatchScreenshot();
    await alert.callMethod('dismiss');
  }

});

Meanwhile other components, such as loading aren't taking screenshots of anything but the basic one. I think we should be consistent here, and update the e2e tests for all of the overlay components to the same style:

  • Action Sheet
  • Alert
  • Loading
  • Menu
  • Modal
  • Picker
  • Popover
  • Toast

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions