Skip to content

Commit

Permalink
Ref #1431 clarify browser tests naming & add 1431_shop_owner_bulk_pau…
Browse files Browse the repository at this point in the history
…se_payment_collection_all_subscribers to tests DAG
  • Loading branch information
chrisjsimpson committed Jan 12, 2025
1 parent 7616d7d commit be6769d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const { set_test_name_cookie } = require('./features/set_test_name_cookie');

const SUBSCRIBER_EMAIL_USER = process.env.TEST_SUBSCRIBER_EMAIL_USER;
test.describe("order plan with only recurring charge test:", () => {
test("@293-1@subscriber@Ordering recurring plan @293_shop_owner_order_recurring_plan", async ({ page }) => {
test("@293-1@subscriber@Ordering recurring plan @293_subscriber_order_recurring_plan", async ({ page }) => {
await admin_login(page);
await set_test_name_cookie(page, "@293_shop_owner_order_recurring_plan")
await set_test_name_cookie(page, "@293_subscriber_order_recurring_plan")

console.log("Ordering plan with only recurring charge...");
// Buy item with subscription & upfront fee
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const { fetch_upcomming_invoices } = require('./features/fetch_upcomming_invoice

const SUBSCRIBER_EMAIL_USER = process.env.TEST_SUBSCRIBER_EMAIL_USER;
test.describe("order plan with recurring and upfront charge test:", () => {
test("@293-3 @293-3_subscriber_order_plan_with_recurring_and_upfront_charge", async ({ page }) => {
console.log("@293-3_subscriber_order_plan_with_recurring_and_upfront_charge");
await set_test_name_cookie(page, "@293-3_subscriber_order_plan_with_recurring_and_upfront_charge")
test("@293-3 @293-3_subscriber_order_plan_with_weekly_recurring_and_upfront_charge", async ({ page }) => {
console.log("@293-3_subscriber_order_plan_with_weekly_recurring_and_upfront_charge");
await set_test_name_cookie(page, "@293-3_subscriber_order_plan_with_weekly_recurring_and_upfront_charge")
// Buy item with subscription & upfront fee
await page.goto('/'); // Go to home before selecting product
await page.click('[name="Hair Gel"]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ test("@334@shop-owner@Creating Private Page @334-shop-owner-create-private-page"
await admin_login(page);
await set_test_name_cookie(page, "@334-shop-owner-create-private-page");
await page.goto('/page/privatetestpage');
await new Promise(x => setTimeout(x, 5000));

console.log("Continuing with Private page creation");
await page.goto('/pages/add-page');
Expand All @@ -17,22 +16,18 @@ test("@334@shop-owner@Creating Private Page @334-shop-owner-create-private-page"
const page_created = await page.content("#alert-heading");
expect(page_created === "Notification");
console.log("Page already created, now configuring to private");
await new Promise(x => setTimeout(x, 3000));

await page.goto('/pages/private-pages');
const private_page_feature = await page.content("text='Update Private Pages'");
expect(private_page_feature === "Update Private Pages");
page.click("input[type=checkbox]");
await new Promise(x => setTimeout(x, 2000));
page.click("text='Submit'");
await new Promise(x => setTimeout(x, 2000));

const private_page_created = await page.content("#alert-heading");
expect(private_page_created === "Notification");
console.log("Private Page created");

await page.goto('/page/privatetestpage');
await new Promise(x => setTimeout(x, 2000));
const visiting_private_page = await page.textContent("text='This is a Private Page'");
expect(visiting_private_page === "This is a Private Page");
console.log("Private Page succedded");
Expand All @@ -44,7 +39,6 @@ test("@334@shop-owner@Creating Private Page @334-shop-owner-create-private-page"
console.log("Logged out");

await page.goto('/page/privatetestpage');
await new Promise(x => setTimeout(x, 3000));
let private_page_content = await page.evaluate(() => document.body.textContent);
if (private_page_content.indexOf("This is a Private Page") > -1) {
console.log("ERROR: the page is not private")
Expand Down
26 changes: 13 additions & 13 deletions tests/browser-automated-tests-playwright/run-playwright-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
"@475_subscriber_order_plan_with_free_trial",
"@264_subscriber_order_plan_with_choice_options_and_required_note",
"@133_subscriber_order_plan_with_cooling_off_period",
"@293_shop_owner_order_recurring_plan",
"@293_subscriber_order_recurring_plan",
"@293-2_subscriber_order_plan_with_only_upfront_charge",
"@293-3_subscriber_order_plan_with_recurring_and_upfront_charge",
"@293-3_subscriber_order_plan_with_weekly_recurring_and_upfront_charge",
"@939_subscriber_order_free_plan_with_terms_and_conditions",
],
"@293-3_subscriber_order_plan_with_recurring_and_upfront_charge": [
"@293-3_subscriber_order_plan_with_weekly_recurring_and_upfront_charge": [
"@stripe_connect",
"@293_shop_owner_order_recurring_plan",
"@293_subscriber_order_recurring_plan",
"@463_subscriber_order_plan_with_vat",
"@475_subscriber_order_plan_with_free_trial",
"@264_subscriber_order_plan_with_choice_options_and_required_note",
"@133_subscriber_order_plan_with_cooling_off_period",
"@293_shop_owner_order_recurring_plan",
"@293_subscriber_order_recurring_plan",
"@293-2_subscriber_order_plan_with_only_upfront_charge",
"@939_subscriber_order_free_plan_with_terms_and_conditions",
],
Expand All @@ -48,11 +48,11 @@
"@stripe_connect",
"@475_shop_owner_create_free_trial",
"@1005_shop_owner_terms_and_conditions_creation",
"@293_shop_owner_order_recurring_plan",
"@293_subscriber_order_recurring_plan",
"@463_subscriber_order_plan_with_vat",
"@264_subscriber_order_plan_with_choice_options_and_required_note",
"@133_subscriber_order_plan_with_cooling_off_period",
"@293_shop_owner_order_recurring_plan",
"@293_subscriber_order_recurring_plan",
"@293-2_subscriber_order_plan_with_only_upfront_charge",
"@939_subscriber_order_free_plan_with_terms_and_conditions",
],
Expand All @@ -64,21 +64,21 @@
"@stripe_connect",
"@133_shop_owner_create_plan_with_cooling_off_period",
],
"@293_shop_owner_order_recurring_plan": [
"@293_subscriber_order_recurring_plan": [
"@stripe_connect",
],
"@293-2_subscriber_order_plan_with_only_upfront_charge": [
"@stripe_connect",
],
"@619_shop_owner_transaction_filter_by_name_and_by_plan_title": [
"@stripe_connect",
"@293-3_subscriber_order_plan_with_recurring_and_upfront_charge",
"@293-3_subscriber_order_plan_with_weekly_recurring_and_upfront_charge",
],
"@905-subscriber-search-by-email-and-name": [
"@293-3_subscriber_order_plan_with_recurring_and_upfront_charge"
"@293-3_subscriber_order_plan_with_weekly_recurring_and_upfront_charge"
],
"@147_shop_owner_pause_resume_and_cancel_subscriptions": [
"@293-3_subscriber_order_plan_with_recurring_and_upfront_charge"
"@293-3_subscriber_order_plan_with_weekly_recurring_and_upfront_charge"
],
"@872_uploading_plan_picture": [],
"@1005_shop_owner_terms_and_conditions_creation": [
Expand Down Expand Up @@ -142,8 +142,8 @@ def run_test(test_name: str):
print(f"Running test {test_name}")
output_path = "./test-videos/" + test_name[1:]
result = subprocess.run(
# f"npx playwright test --grep {test_name} --headed --retries 0 --update-snapshots",
f"npx playwright test --update-snapshots --grep '{test_name}' --output '{output_path}'",
# f"npx playwright test --grep {test_name} --headed --retries 0 --update-snapshots", # noqa: E501
f"npx playwright test --update-snapshots --grep '{test_name}' --output '{output_path}'", # noqa: E501
shell=True,
)
if result.returncode != 0:
Expand Down

0 comments on commit be6769d

Please sign in to comment.