Skip to content

Commit

Permalink
#1431 remove duplicate tests & fix other tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsimpson committed Jan 6, 2025
1 parent 0404783 commit afbb2ae
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 424 deletions.
1 change: 1 addition & 0 deletions subscribie/blueprints/admin/templates/admin/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h3 class="card-title">Checklist</h3>
</li>
{% endif %}
{% if reply_to_email_address is sameas None %}
<br />
<li>
🔔 Improve support for your subscribers by <a href="{{ url_for('admin.set_reply_to_email') }}">setting your support email address 🔔</a>
</li>
Expand Down
9 changes: 8 additions & 1 deletion subscribie/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,16 @@ def load_settings():
for key in schema._required_keys:
if key in os.environ:
print(f"Overriding setting {key} with environ value: {os.getenv(key)}")
print(
(
"If overriding keeps happening & you can't "
"work out why- check your IDE (hello vscode) "
"isn't getting in the way. Try using a terminal instead."
)
)
settings[key] = os.getenv(key)
return settings


# Load app setttings via strictyaml & schema
# Load app settings via strictyaml & schema
settings = load_settings().data
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ test("@1005@shop-owner @1005_shop_owner_terms_and_conditions_creation", async ({
console.log("checking if terms and conditions is already attached to the free plan...");
await page.goto('/');
await page.click('[name="Free plan"]');
page.setDefaultTimeout(3000);
await new Promise(x => setTimeout(x, 1000));
let terms_and_conditions_attached = await page.evaluate(() => document.body.textContent);
if (terms_and_conditions_attached.indexOf("Terms and Conditions") > -1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ test.describe("order free plan tests:", () => {

await admin_login(page);
await page.goto('/admin/change-thank-you-url');
await page.reload(); // ensure refresh
await page.fill('#custom_thank_you_url', 'https://www.google.com');
await page.click('role=button[name="Save"]');
const custom_url = await page.textContent('text="Custom thank you url changed to: https://www.google.com"');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ test.describe("Plan Creation tests:", () => {
//add first option
console.log("adding options...")
await page.goto('/admin/list-choice-groups');
await page.click("text=Options");
await page.getByRole('button', { name: 'Options' }).click();

await page.click("text=Add Option");
await page.fill('.form-control', 'Red');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ test.describe("order plan with cooling off:", () => {
await page.goto('/admin/upcoming-invoices');
// Fetch Upcoming Invoices
await fetch_upcomming_invoices(page);
const content_upcoming_invoice_plan_price_interval = await page.textContent('.plan-price-interval');
expect(content_upcoming_invoice_plan_price_interval === '£10.00');
await expect(page.locator("li >> text=£10.00").first()).toBeVisible();
await expect(page.locator("li >> text=Cooling off plan").first()).toBeVisible();

const content_upcoming_invoice_plan_sell_price = await page.textContent('.upcoming-invoices-plan-no-sell_price');
expect(content_upcoming_invoice_plan_sell_price === '(No up-front cost)');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ test.describe("Pause, Resume and Cancel Subscription:", () => {
const subscription_pause_notification = await page.textContent('text="Subscription paused"');
expect(subscription_pause_notification === "Subscription paused");

// Click Refresh Subscription
await page.click('#refresh_subscriptions'); // this is the refresh subscription
await page.textContent('.alert-heading') === "Notification";

await new Promise(x => setTimeout(x, 3000)); // 3 secconds
await page.goto('admin/subscribers')

//Resume Subscription
await page.click('.resume-action');
await new Promise(x => setTimeout(x, 3000)); // 3 secconds
await new Promise(x => setTimeout(x, 3000)); // 3 seconds
await page.click('.resume-yes');
await new Promise(x => setTimeout(x, 3000)); // 3 seconds
const subscription_resume_notification = await page.textContent('text="Subscription resumed"');
Expand Down

This file was deleted.

Loading

0 comments on commit afbb2ae

Please sign in to comment.