add a config for local testing, plus add mobile testing and some instructions

This commit is contained in:
2024-07-27 16:52:44 -06:00
parent 791a35d97c
commit 6191a4893f
5 changed files with 130 additions and 15 deletions

View File

@@ -1,8 +1,14 @@
import { test, expect } from '@playwright/test';
test('Confirm usage of test API', async ({ page }) => {
test('Confirm usage of test API', async ({ page }, testInfo) => {
// Load account view
await page.goto('./account');
await page.getByRole('heading', { name: 'Advanced' }).click();
await expect(page.getByRole('textbox').nth(1)).toHaveValue('https://test-api.endorser.ch');
const webServer = testInfo.config.webServer;
const endorserWords = webServer?.command.split(' ');
const ENDORSER_ENV_NAME = 'VITE_DEFAULT_ENDORSER_API_SERVER';
const endorserTerm = endorserWords?.find(word => word.startsWith(ENDORSER_ENV_NAME + '='));
const endorserServer = endorserTerm?.substring(ENDORSER_ENV_NAME.length + 1) || 'https://test-api.endorser.ch';
await expect(page.getByRole('textbox').nth(1)).toHaveValue(endorserServer);
});