Update nightly tests with proper locator and increase max duration

[MAILPOET-5411]
This commit is contained in:
Veljko
2023-06-16 13:06:39 +02:00
committed by Veljko V
parent c0bdb01965
commit a63cc229fc
6 changed files with 33 additions and 13 deletions

View File

@@ -47,14 +47,14 @@ let scenarios = {
executor: 'per-vu-iterations',
vus: 1,
iterations: 1,
maxDuration: '5m',
maxDuration: '10m',
exec: 'pullRequests',
},
nightlytests: {
executor: 'per-vu-iterations',
vus: 1,
iterations: 3,
maxDuration: '15m',
iterations: 1,
maxDuration: '30m',
exec: 'nightly',
},
};

View File

@@ -141,15 +141,20 @@ export async function listsComplexSegment() {
await page.waitForSelector('[data-automation-id="filters_all"]', {
state: 'visible',
});
const locator =
"//div[@class='notice-success'].//p[starts-with(text(),'Segment successfully updated!')]";
describe(listsPageTitle, () => {
describe('should be able to see Segment Updated message', () => {
expect(page.locator('div.notice').innerText()).to.contain(
'Segment successfully updated!',
);
expect(page.locator(locator)).to.exist;
});
});
await page.waitForLoadState('networkidle');
await page.screenshot({
path: screenshotPath + 'Lists_Complex_Segment_05.png',
fullPage: fullPageSet,
});
// Thinking time and closing
sleep(randomIntBetween(thinkTimeMin, thinkTimeMax));
page.close();

View File

@@ -95,12 +95,12 @@ export async function newsletterSending() {
});
// 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');
describe(emailsPageTitle, () => {
describe('should be able to see Newsletter Sent message', () => {
expect(page.locator('div > .notice-success').innerText()).to.contain(
'The newsletter is being sent...',
);
expect(page.locator(locator)).to.exist;
});
});
await page.waitForLoadState('networkidle');

View File

@@ -56,14 +56,19 @@ export async function settingsBasic() {
await page.waitForLoadState('networkidle');
// Check if there's notice about saved settings
const locator =
"//div[@class='notice-success'].//p[starts-with(text(),'Settings saved')]";
describe(settingsPageTitle, () => {
describe('should be able to see Settings Saved message', () => {
expect(page.locator('div.notice').innerText()).to.contain(
'Settings saved',
);
expect(page.locator(locator)).to.exist;
});
});
await page.screenshot({
path: screenshotPath + 'Settings_Basic_02.png',
fullPage: fullPageSet,
});
// Thinking time and closing
sleep(randomIntBetween(thinkTimeMin, thinkTimeMax));
page.close();

View File

@@ -67,11 +67,11 @@ export async function subscribersAdding() {
await page.locator('input[name="last_name"]').type(lastName);
selectInSelect2(page, defaultListName);
await page.locator('button[type="submit"]').click();
await page.waitForLoadState('networkidle');
// Verify you see the success message and the filter is visible
const locator =
"//div[@class='notice-success'].//p[starts-with(text(),'Subscriber was added successfully!')]";
await page.waitForSelector(locator);
describe(subscribersPageTitle, () => {
describe('should be able to see Subscriber Added message', () => {
expect(page.locator(locator)).to.exist;

View File

@@ -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
await page.locator('[data-automation-id="filters_trash"]').click();
await page.waitForSelector('[data-automation-id="empty_trash"]');
@@ -87,6 +92,11 @@ export async function subscribersTrashingRestoring() {
waitForSelectorToBeVisible(page, '.colspanchange');
waitForSelectorToBeVisible(page, '[data-automation-id="filters_subscribed"]');
await page.screenshot({
path: screenshotPath + 'Subscribers_Trashing_Restoring_03.png',
fullPage: fullPageSet,
});
// Thinking time and closing
sleep(randomIntBetween(thinkTimeMin, thinkTimeMax));
page.close();