-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathUserAdminCsvImportCept.php
More file actions
31 lines (22 loc) · 1 KB
/
Copy pathUserAdminCsvImportCept.php
File metadata and controls
31 lines (22 loc) · 1 KB
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
<?php
/** @var \Codeception\Scenario $scenario */
use Tests\Support\AcceptanceTester;
$I = new AcceptanceTester($scenario);
$I->populateDBData1();
$I->wantTo('Test CSV User Import JS Frontend Logic');
$I->loginAndGotoStdAdminPage()->gotoUserAdministration();
// Ensure the form is accessible via the opener
$I->clickJS('.addUsersOpener.csv');
// Form and elements should be visible
$I->seeElement('#csvImportForm');
$I->seeElement('#csvSubmitBtn');
// Progress container should be hidden initially
$I->dontSeeElement('#csvProgressContainer:not(.hidden)');
// Remove the required attribute so we can submit the form without an actual file,
// triggering the JS submit event instead of HTML5 validation
$I->executeJS("document.querySelector('input[name=\"csvFile\"]').removeAttribute('required');");
// Click the submit button
$I->clickJS('#csvSubmitBtn');
// The JS logic should catch the submit, prevent default, and show the progress container
$I->wait(0.5);
$I->seeElement('#csvProgressContainer:not(.hidden)');