All files / realm/blong-party/test person.play.ts

100% Statements 49/49
100% Branches 1/1
100% Functions 0/0
100% Lines 49/49

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 501x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 1x  
/**
 * Person CRUD — Browse, Create, Edit full-stack tests.
 *
 * Covers text, select (gender, marital status), date, and textarea widget types.
 * Widget types are auto-detected from the DOM — no explicit `widget:` needed.
 *
 * Every test that touches a record pins it by this spec's own marker, `Playwright`.
 * The edit test used to open the **first row of the table**, which is whichever
 * person the database happens to answer first — a person the google-login spec had
 * created in one run, a seeded `Ahmed Hassan` in the next — so its capture compared
 * two different records and failed on data rather than on layout (`F-610`).
 */
import {expect, test} from '@feasibleone/blong-browser/playwright';
import {browseModel, createAndEditModel} from '@feasibleone/blong-browser/playwright/model';
 
test.use({blongPermissions: true});
 
test.describe('Party Person', () => {
    browseModel(test, expect, {
        subject: 'party',
        object: 'person',
        searchText: 'Doe',
    });
 
    createAndEditModel(test, expect, {
        subject: 'party',
        object: 'person',
        fields: {
            // The full name is the row's display name and its searchable key: the
            // other parts alone leave the record unnamed in every table it appears in.
            'person.personName': 'Test Playwright Person',
            'person.firstName': 'Test',
            'person.middleName': 'Playwright',
            'person.lastName': 'Person',
            'person.birthDate': '06/15/1990',
            'person.gender': 'Male',
            'person.maritalStatus': 'Single',
            'person.nationality': 'US',
            'person.occupation': 'Test Engineer',
            'person.notes': 'A test person created by Playwright',
        },
        editFields: {
            'person.firstName': 'Test Edited',
            'person.lastName': 'Person Edited',
        },
        // Open *this* spec's record, not the first row the table answers with.
        search: 'Test Playwright',
    });
});