oncall-engine/grafana-plugin/e2e/features/steps/deleteNotificationSteps.js
Michael Derynck 6b40f95033 World, meet OnCall!
Co-authored-by: Eve832 <eve.meelan@grafana.com>
    Co-authored-by: Francisco Montes de Oca <nevermind89x@gmail.com>
    Co-authored-by: Ildar Iskhakov <ildar.iskhakov@grafana.com>
    Co-authored-by: Innokentii Konstantinov <innokenty.konstantinov@grafana.com>
    Co-authored-by: Julia <ferril.darkdiver@gmail.com>
    Co-authored-by: maskin25 <kengurek@gmail.com>
    Co-authored-by: Matias Bordese <mbordese@gmail.com>
    Co-authored-by: Matvey Kukuy <motakuk@gmail.com>
    Co-authored-by: Michael Derynck <michael.derynck@grafana.com>
    Co-authored-by: Richard Hartmann <richih@richih.org>
    Co-authored-by: Robby Milo <robbymilo@fastmail.com>
    Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
    Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
    Co-authored-by: Yulia Shanyrova <yulia.shanyrova@grafana.com>
2022-06-03 08:09:47 -06:00

51 lines
1.4 KiB
JavaScript

const { When, Given, Before, Then, After, setDefaultTimeout } = require('@cucumber/cucumber');
const { Builder, By, until } = require('selenium-webdriver');
const { takeScreenshot } = require('../../utils/takeScreenshot');
const { setup, checkTitle } = require('./common');
const assert = require('assert');
When('Go to my settings page', async function () {
var menuItem = await this.driver.findElement(By.className('TEST-users-menu-item'));
menuItem.click();
this.driver.sleep(3000);
});
Then('We see my settings page', async function f() {
await this.driver.wait(until.elementLocated(By.className('TEST-users-page')));
});
When('Click edit button', async function () {
const editButton = await this.driver.findElement(By.className('TEST-edit-my-own-settings-button'));
editButton.click();
});
Then('We see settings popup', async function () {
await this.driver.findElement(By.className('TEST-user-settings-modal'));
this.driver.sleep(3000);
});
When('Delete all notification policies', async function () {
const deleteNotificationButtons = await this.driver.findElements(
By.className('TEST-delete-notification-policy-button')
);
await (async function () {
for (const item of deleteNotificationButtons) {
await (async function () {
return new Promise((resolve) =>
setTimeout(() => {
item.click();
resolve();
}, 1500)
);
})();
}
})();
});