Skip to content

Commit

Permalink
feat: add ADMIN_API_URL env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
iNem0o committed Jan 30, 2025
1 parent b58761b commit 452c10a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ if (process.env['ADMIN_URL']) {
} else {
process.env['ADMIN_URL'] = process.env['APP_URL'] + 'admin/';
}

if (process.env['ADMIN_API_URL']) {
process.env['ADMIN_API_URL'] = (process.env['ADMIN_API_URL'] ?? '').replace(/\/+$/, '') + '/';
}
if (!process.env['WEBSERVER_COMMAND']) {
if (process.env['WEBSERVER_COMMAND'] === defaultAppUrl) {
process.env['WEBSERVER_COMMAND'] = 'docker compose up --pull=always --quiet-pull shopware';
Expand Down
2 changes: 1 addition & 1 deletion src/services/AdminApiContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class AdminApiContext {
public readonly options: AdminApiContextOptions;

private static readonly defaultOptions: AdminApiContextOptions = {
app_url: process.env['APP_URL'],
app_url: process.env['ADMIN_API_URL'] || process.env['APP_URL'],
client_id: process.env['SHOPWARE_ACCESS_KEY_ID'],
client_secret: process.env['SHOPWARE_SECRET_ACCESS_KEY'],
admin_username: process.env['SHOPWARE_ADMIN_USERNAME'] || 'admin',
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/shop-admin/Product/SaveProduct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const SaveProduct = base.extend<{ SaveProduct: Task }, FixtureTypes>({
await AdminProductDetail.savePhysicalProductButton.click();

// Wait until product is saved via API
const response = await AdminProductDetail.page.waitForResponse(`${process.env['APP_URL']}api/_action/sync`);
const response = await AdminProductDetail.page.waitForResponse(`${process.env['ADMIN_API_URL'] || process.env['APP_URL']}api/_action/sync`);

// Assertions
expect(response.ok()).toBeTruthy();
Expand Down

0 comments on commit 452c10a

Please sign in to comment.