Skip to content

Commit

Permalink
fix: add waiting time after action
Browse files Browse the repository at this point in the history
  • Loading branch information
kielllll committed Nov 26, 2024
1 parent 1f45f88 commit 8841742
Showing 1 changed file with 32 additions and 23 deletions.
55 changes: 32 additions & 23 deletions tests/e2e/pdf-settings/advanced/restrict-owner-field.test.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
import { fieldLabel } from '../../utilities/page-model/helpers/field'
import Pdf from '../../utilities/page-model/helpers/pdf'
import { fieldLabel } from '../../utilities/page-model/helpers/field';
import Pdf from '../../utilities/page-model/helpers/pdf';

const run = new Pdf()
const run = new Pdf();

fixture`PDF advanced settings - Restrict owner field test`
fixture`PDF advanced settings - Restrict owner field test`;

test('should display \'Restrict Owner\' field', async t => {
// Actions
await run.navigatePdfSection('gf_edit_forms&view=settings&subview=PDF&id=4')
test("should display 'Restrict Owner' field", async (t) => {
// Actions
await run.navigatePdfSection(
'gf_edit_forms&view=settings&subview=PDF&id=4'
);

// Assertions
await t
.expect(fieldLabel('Restrict Owner').exists).ok()
.expect(run.restrictOwnerCheckbox.exists).ok()
})
// Assertions
await t
.expect(fieldLabel('Restrict Owner').exists)
.ok()
.expect(run.restrictOwnerCheckbox.exists)
.ok();
});

test('should save toggled checkbox value', async t => {
// Actions & Assertions
await run.navigatePdfSection('gf_edit_forms&view=settings&subview=PDF&id=4')
await t
.click(run.restrictOwnerCheckbox)
.click(run.saveSettings)
.expect(run.restrictOwnerCheckbox.checked).ok()
.click(run.restrictOwnerCheckbox)
.click(run.saveSettings)
.expect(run.restrictOwnerCheckbox.checked).notOk()
})
test('should save toggled checkbox value', async (t) => {
// Actions & Assertions
await run.navigatePdfSection(
'gf_edit_forms&view=settings&subview=PDF&id=4'
);
await t
.click(run.restrictOwnerCheckbox)
.click(run.saveSettings)
.wait(500)
.expect(run.restrictOwnerCheckbox.checked)
.ok()
.click(run.restrictOwnerCheckbox)
.click(run.saveSettings)
.expect(run.restrictOwnerCheckbox.checked)
.notOk();
});

0 comments on commit 8841742

Please sign in to comment.