1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-12 19:20:27 +00:00
TiddlyWiki5/editions/test/playwright.spec.js
webplusai a930411cfd
Handle directory creation if doesn't exist for test store (#8562)
* fix breaking bug in image tiddler attachment

* fix comments

* fix code format

* refactor processIncomingTiddler flow

* remove whitespaces after if statements

* refactor attachment_blob persistence flow

* refactor process tiddler to support different attachments

* add tests for attachment

* add more attachement test cases

* working on adding instanbul for test coverage report

* code coverage report generation

* remove unnecessary packages

* fix comments

* handle directory creation if doesn't exist for test store

* resolve issue with CI tests failure
2024-08-30 13:14:18 +01:00

26 lines
1.1 KiB
JavaScript

const { test, expect } = require('@playwright/test');
const {resolve} = require('path');
const indexPath = resolve(__dirname, 'output', 'test.html');
const crossPlatformIndexPath = indexPath.replace(/^\/+/, '');
test('get started link', async ({ page }) => {
// The tests can take a while to run
const timeout = 1000 * 30;
test.setTimeout(timeout);
// Load the generated test TW html
await page.goto(`file:///${crossPlatformIndexPath}`);
const title = await page.title();
// Sanity check
await expect(title, "Expected correct page title to verify the test page was loaded").toContain('TiddlyWiki5');
// Wait for jasmine results bar to appear
await expect(page.locator('.jasmine-overall-result'), "Expected jasmine test results bar to be present").toBeVisible({timeout});
// Assert the tests have passed
await expect(page.locator('.jasmine-overall-result.jasmine-failed'), "Expected jasmine tests to not have failed").not.toBeVisible();
await expect(page.locator('.jasmine-overall-result.jasmine-passed'), "Expected jasmine tests to have passed").toBeVisible();
});