Complete the test and update xk6-binary file to the latest

[MAILPOET-4956]
This commit is contained in:
Veljko
2023-02-22 11:24:58 +01:00
committed by Veljko V
parent 14e2fcfef3
commit d406e7c05e
3 changed files with 17 additions and 9 deletions

View File

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

View File

@@ -1,4 +1,3 @@
/* eslint-disable no-shadow */
/* eslint-disable import/no-unresolved */
/* eslint-disable import/no-default-export */
/**
@@ -31,7 +30,10 @@ export function subscribersAdding() {
});
const page = browser.newPage();
group('Subscribers - Add a new subscriber', function subscribersAdding() {
group('Subscribers - Add a new subscriber', () => {
let subscriberEmail =
'test+' + Math.floor(Math.random() * 9999 + 1) + '@test.com';
page
.goto(`${baseURL}/wp-admin/admin.php?page=mailpoet-subscribers`, {
waitUntil: 'networkidle',
@@ -51,9 +53,7 @@ export function subscribersAdding() {
page
.locator('[data-automation-id="add-new-subscribers-button"]')
.click();
page
.locator('input[name="email"]')
.type('test+' + Math.floor(Math.random() * 9999 + 1) + '@test.com');
page.locator('input[name="email"]').type(subscriberEmail);
page.locator('input[name="first_name"]').type(firstName);
page.locator('input[name="last_name"]').type(lastName);
selectInSelect2(page, defaultListName);
@@ -68,7 +68,15 @@ export function subscribersAdding() {
})
.then(() => {
// search for added subscriber
page.waitForNavigation({ waitUntil: 'networkidle' });
page.locator('#search_input').type(subscriberEmail, { delay: 50 });
page.waitForSelector('.mailpoet-listing-no-items');
page.waitForSelector('[data-automation-id="filters_subscribed"]');
check(page, {
'newly added subscriber is present in the listing':
page.locator('.mailpoet-listing-title').textContent() ===
subscriberEmail,
});
})
.finally(() => {

View File

@@ -22,7 +22,7 @@ if (!file_exists($vendorDir)) {
}
// paths
$version = 'v0.7.0';
$version = 'v0.8.1';
$extension = $os === 'macos' || $os === 'windows' ? 'zip' : 'tar.gz';
$name = "xk6-browser-$version-$os-$arch";
$url = "https://github.com/grafana/xk6-browser/releases/download/$version/$name.$extension";