Skip to content

Commit

Permalink
Initial stab at JS smoke test for use (#2935)
Browse files Browse the repository at this point in the history
* Initial  JS smoke test for use

* Update AccountContext.php

* Change wording of gerkin scenario

---------

Co-authored-by: Adam Cooper <[email protected]>
  • Loading branch information
mattmachell and cooperaj authored Dec 4, 2024
1 parent 393af04 commit b1398ac
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
6 changes: 5 additions & 1 deletion service-front/web/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ if (
document.getElementById('dialog') !== null
) {
new sessionDialog(document.getElementById('dialog'));
}
}

//used by smoke test

window.useAnLPALoaded = true;
1 change: 1 addition & 0 deletions tests/features/actor-login.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Feature: A user of the system is able to login
Given I access the login form
When I enter correct credentials
Then I am signed in
And the javascript is working
14 changes: 14 additions & 0 deletions tests/smoke/context/AccountContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,18 @@ public function iAmSignedIn(): void
$this->ui->assertElementOnPage('nav.signin');
}
}

/**
* @Then the javascript is working
*/

public function scriptsWork(): void
{
if(!$this->ui->getSession()->evaluateScript("return window.useAnLPALoaded")){
throw new ExpectationException(
'Javascript did not parse without errors',
$this->ui->getMink()->getSession()->getDriver()
);
}
}
}

0 comments on commit b1398ac

Please sign in to comment.