Update nightly tests with proper locator and increase max duration
[MAILPOET-5411]
This commit is contained in:
@@ -47,14 +47,14 @@ let scenarios = {
|
|||||||
executor: 'per-vu-iterations',
|
executor: 'per-vu-iterations',
|
||||||
vus: 1,
|
vus: 1,
|
||||||
iterations: 1,
|
iterations: 1,
|
||||||
maxDuration: '5m',
|
maxDuration: '10m',
|
||||||
exec: 'pullRequests',
|
exec: 'pullRequests',
|
||||||
},
|
},
|
||||||
nightlytests: {
|
nightlytests: {
|
||||||
executor: 'per-vu-iterations',
|
executor: 'per-vu-iterations',
|
||||||
vus: 1,
|
vus: 1,
|
||||||
iterations: 3,
|
iterations: 1,
|
||||||
maxDuration: '15m',
|
maxDuration: '30m',
|
||||||
exec: 'nightly',
|
exec: 'nightly',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@@ -141,15 +141,20 @@ export async function listsComplexSegment() {
|
|||||||
await page.waitForSelector('[data-automation-id="filters_all"]', {
|
await page.waitForSelector('[data-automation-id="filters_all"]', {
|
||||||
state: 'visible',
|
state: 'visible',
|
||||||
});
|
});
|
||||||
|
const locator =
|
||||||
|
"//div[@class='notice-success'].//p[starts-with(text(),'Segment successfully updated!')]";
|
||||||
describe(listsPageTitle, () => {
|
describe(listsPageTitle, () => {
|
||||||
describe('should be able to see Segment Updated message', () => {
|
describe('should be able to see Segment Updated message', () => {
|
||||||
expect(page.locator('div.notice').innerText()).to.contain(
|
expect(page.locator(locator)).to.exist;
|
||||||
'Segment successfully updated!',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
await page.waitForLoadState('networkidle');
|
await page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
|
await page.screenshot({
|
||||||
|
path: screenshotPath + 'Lists_Complex_Segment_05.png',
|
||||||
|
fullPage: fullPageSet,
|
||||||
|
});
|
||||||
|
|
||||||
// Thinking time and closing
|
// Thinking time and closing
|
||||||
sleep(randomIntBetween(thinkTimeMin, thinkTimeMax));
|
sleep(randomIntBetween(thinkTimeMin, thinkTimeMax));
|
||||||
page.close();
|
page.close();
|
||||||
|
@@ -95,12 +95,12 @@ export async function newsletterSending() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Wait for the success notice message and confirm it
|
// Wait for the success notice message and confirm it
|
||||||
|
const locator =
|
||||||
|
"//div[@class='notice-success'].//p[starts-with(text(),'Subscriber was added successfully!')]";
|
||||||
await page.waitForSelector('#mailpoet_notices');
|
await page.waitForSelector('#mailpoet_notices');
|
||||||
describe(emailsPageTitle, () => {
|
describe(emailsPageTitle, () => {
|
||||||
describe('should be able to see Newsletter Sent message', () => {
|
describe('should be able to see Newsletter Sent message', () => {
|
||||||
expect(page.locator('div > .notice-success').innerText()).to.contain(
|
expect(page.locator(locator)).to.exist;
|
||||||
'The newsletter is being sent...',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
await page.waitForLoadState('networkidle');
|
await page.waitForLoadState('networkidle');
|
||||||
|
@@ -56,14 +56,19 @@ export async function settingsBasic() {
|
|||||||
await page.waitForLoadState('networkidle');
|
await page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
// Check if there's notice about saved settings
|
// Check if there's notice about saved settings
|
||||||
|
const locator =
|
||||||
|
"//div[@class='notice-success'].//p[starts-with(text(),'Settings saved')]";
|
||||||
describe(settingsPageTitle, () => {
|
describe(settingsPageTitle, () => {
|
||||||
describe('should be able to see Settings Saved message', () => {
|
describe('should be able to see Settings Saved message', () => {
|
||||||
expect(page.locator('div.notice').innerText()).to.contain(
|
expect(page.locator(locator)).to.exist;
|
||||||
'Settings saved',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await page.screenshot({
|
||||||
|
path: screenshotPath + 'Settings_Basic_02.png',
|
||||||
|
fullPage: fullPageSet,
|
||||||
|
});
|
||||||
|
|
||||||
// Thinking time and closing
|
// Thinking time and closing
|
||||||
sleep(randomIntBetween(thinkTimeMin, thinkTimeMax));
|
sleep(randomIntBetween(thinkTimeMin, thinkTimeMax));
|
||||||
page.close();
|
page.close();
|
||||||
|
@@ -67,11 +67,11 @@ export async function subscribersAdding() {
|
|||||||
await page.locator('input[name="last_name"]').type(lastName);
|
await page.locator('input[name="last_name"]').type(lastName);
|
||||||
selectInSelect2(page, defaultListName);
|
selectInSelect2(page, defaultListName);
|
||||||
await page.locator('button[type="submit"]').click();
|
await page.locator('button[type="submit"]').click();
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
// Verify you see the success message and the filter is visible
|
// Verify you see the success message and the filter is visible
|
||||||
const locator =
|
const locator =
|
||||||
"//div[@class='notice-success'].//p[starts-with(text(),'Subscriber was added successfully!')]";
|
"//div[@class='notice-success'].//p[starts-with(text(),'Subscriber was added successfully!')]";
|
||||||
await page.waitForSelector(locator);
|
|
||||||
describe(subscribersPageTitle, () => {
|
describe(subscribersPageTitle, () => {
|
||||||
describe('should be able to see Subscriber Added message', () => {
|
describe('should be able to see Subscriber Added message', () => {
|
||||||
expect(page.locator(locator)).to.exist;
|
expect(page.locator(locator)).to.exist;
|
||||||
|
@@ -74,6 +74,11 @@ export async function subscribersTrashingRestoring() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await page.screenshot({
|
||||||
|
path: screenshotPath + 'Subscribers_Trashing_Restoring_02.png',
|
||||||
|
fullPage: fullPageSet,
|
||||||
|
});
|
||||||
|
|
||||||
// Restore from trash all the trashed subscribers
|
// Restore from trash all the trashed subscribers
|
||||||
await page.locator('[data-automation-id="filters_trash"]').click();
|
await page.locator('[data-automation-id="filters_trash"]').click();
|
||||||
await page.waitForSelector('[data-automation-id="empty_trash"]');
|
await page.waitForSelector('[data-automation-id="empty_trash"]');
|
||||||
@@ -87,6 +92,11 @@ export async function subscribersTrashingRestoring() {
|
|||||||
waitForSelectorToBeVisible(page, '.colspanchange');
|
waitForSelectorToBeVisible(page, '.colspanchange');
|
||||||
waitForSelectorToBeVisible(page, '[data-automation-id="filters_subscribed"]');
|
waitForSelectorToBeVisible(page, '[data-automation-id="filters_subscribed"]');
|
||||||
|
|
||||||
|
await page.screenshot({
|
||||||
|
path: screenshotPath + 'Subscribers_Trashing_Restoring_03.png',
|
||||||
|
fullPage: fullPageSet,
|
||||||
|
});
|
||||||
|
|
||||||
// Thinking time and closing
|
// Thinking time and closing
|
||||||
sleep(randomIntBetween(thinkTimeMin, thinkTimeMax));
|
sleep(randomIntBetween(thinkTimeMin, thinkTimeMax));
|
||||||
page.close();
|
page.close();
|
||||||
|
Reference in New Issue
Block a user