Skip to content

Commit

Permalink
Adding UI test cases around new feature
Browse files Browse the repository at this point in the history
  • Loading branch information
snake14 committed Nov 27, 2024
1 parent 540016e commit 82b4f7b
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 0 deletions.
45 changes: 45 additions & 0 deletions tests/UI/ContainerTrigger_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,49 @@ describe("ContainerTrigger", function () {
await page.waitForTimeout(250);
await capture.page(page, 'create_new_long_name');
});

it('should show dialog to copy trigger', async function () {
await page.goto(container1Base);
await clickFirstRowTableAction('icon-content-copy', 3);
await page.waitForNetworkIdle();
pageWrap = await page.waitForSelector('div.ui-dialog.mtmCopyTrigger');
expect(await pageWrap.screenshot()).to.matchImage('copy_trigger_dialog');
});

it('should show list of containers to copy trigger to', async function () {
await page.evaluate(() => $('div.matomo-field-select div.select-wrapper input.dropdown-trigger')[0].click());
await page.waitForTimeout(250);
pageWrap = await page.waitForSelector('div.ui-dialog.mtmCopyTrigger');
expect(await pageWrap.screenshot()).to.matchImage('copy_trigger_container_select');
});

it('should select container to copy trigger to', async function () {
await page.evaluate(() => $('div.matomo-field-select ul li:first').click());
await page.waitForTimeout(250);
pageWrap = await page.waitForSelector('div.ui-dialog.mtmCopyTrigger');
expect(await pageWrap.screenshot()).to.matchImage('copy_trigger_container_selected');
});

it('should show list of sites to copy trigger to', async function () {
await page.click('#destinationSite');
await page.waitForTimeout(250);
pageWrap = await page.waitForSelector('div.ui-dialog.mtmCopyTrigger');
expect(await pageWrap.screenshot()).to.matchImage('copy_trigger_site_select');
});

it('should select site to copy trigger to', async function () {
await page.evaluate(() => $('#destinationSite ul li:first').click());
await page.waitForTimeout(250);
pageWrap = await page.waitForSelector('div.ui-dialog.mtmCopyTrigger');
expect(await pageWrap.screenshot()).to.matchImage('copy_trigger_site_selected');
});

it('should be able to copy trigger', async function () {
await page.goto(container1Base);
await clickFirstRowTableAction('icon-content-copy', 3);
await page.waitForNetworkIdle();
await page.evaluate(() => $('div.copyMtmObjectDialog button.btn').click());
await page.waitForNetworkIdle();
await capture.page(page, 'copy_trigger_success');
});
});
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.
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.
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 82b4f7b

Please sign in to comment.