finally some bloody test works
This commit is contained in:
parent
a1e07724ce
commit
1b5f227318
2 changed files with 47 additions and 20 deletions
|
|
@ -1,11 +1,15 @@
|
|||
const { test, expect } = require('./test-setup');
|
||||
const { test, expect, hardcodedSessionUuid } = require('./test-setup');
|
||||
|
||||
const SessionCreated = require('../src/models/SessionCreated');
|
||||
const SessionRelatedToPublickey = require('../src/models/SessionRelatedToPublickey');
|
||||
const NymSet = require('../src/models/NymSet');
|
||||
const ContactDetailsSet = require('../src/models/ContactDetailsSet');
|
||||
|
||||
const sessionService = require('../src/services/sessionService');
|
||||
|
||||
test('Mock records are present', async ({ page }) => {
|
||||
for (const someModel of [
|
||||
SessionCreated,
|
||||
SessionRelatedToPublickey,
|
||||
NymSet,
|
||||
ContactDetailsSet,
|
||||
|
|
@ -14,19 +18,22 @@ test('Mock records are present', async ({ page }) => {
|
|||
}
|
||||
});
|
||||
|
||||
test('Session cookie is there', async ({ page }) => {
|
||||
await page.goto('http://localhost');
|
||||
|
||||
test('Hardcoded session cookie is there', async ({ context }) => {
|
||||
const page = await context.newPage();
|
||||
const cookiesInPage = await page.context().cookies();
|
||||
expect(cookiesInPage).toHaveLength(1);
|
||||
expect(cookiesInPage[0].name).toBe('sessionUuid');
|
||||
expect(cookiesInPage[0].value).toBe(hardcodedSessionUuid);
|
||||
});
|
||||
|
||||
test('Offers is reachable', async ({ page }) => {
|
||||
test('Offers is reachable', async ({ context }) => {
|
||||
const page = await context.newPage();
|
||||
const cookiez = await page.context().cookies();
|
||||
|
||||
await page.pause();
|
||||
await page.goto('http://localhost/offers');
|
||||
console.log(await page.innerHTML('html'));
|
||||
|
||||
const createOfferButton = page.locator('#button-start-create-offer');
|
||||
await expect(createOfferButton).toBeVisible();
|
||||
await expect(createOfferButton).toContainText('Crear nueva oferta');
|
||||
});
|
||||
|
||||
// Check that UI controls are manageable with a few test cases.
|
||||
|
||||
// Check that the offer is created after submitting
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue