Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
varbase-3293696
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
varbase-3293696
Commits
88ee930e
Commit
88ee930e
authored
4 years ago
by
Rajab Natshah
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3120794
: Fix Automated Functional Acceptance Testing on unexpected alert open
parent
7ec7e495
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/features/bootstrap/VarbaseContext.php
+2
-58
2 additions, 58 deletions
tests/features/bootstrap/VarbaseContext.php
with
2 additions
and
58 deletions
tests/features/bootstrap/VarbaseContext.php
+
2
−
58
View file @
88ee930e
...
@@ -202,7 +202,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
...
@@ -202,7 +202,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
* @Given /^(?:|I )wait max of (?P<time>\d+)s(?:| for the page to be ready and loaded)$/
* @Given /^(?:|I )wait max of (?P<time>\d+)s(?:| for the page to be ready and loaded)$/
* @Given /^(?:|I )wait(?:| for the page)$/
* @Given /^(?:|I )wait(?:| for the page)$/
*
*
* @throws
Behavior
Exception
* @throws Exception
* If timeout is reached.
* If timeout is reached.
*/
*/
public
function
iWaitMaxOfSecondsForThePageToBeReadyAndLoaded
(
$time
=
10000
)
{
public
function
iWaitMaxOfSecondsForThePageToBeReadyAndLoaded
(
$time
=
10000
)
{
...
@@ -231,7 +231,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
...
@@ -231,7 +231,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
$this
->
getSession
()
->
wait
(
$time
,
$condition
);
$this
->
getSession
()
->
wait
(
$time
,
$condition
);
// Check if we reached the timeout unless the condition is false to explicitly wait the specified time.
// Check if we reached the timeout unless the condition is false to explicitly wait the specified time.
if
(
$condition
!==
FALSE
&&
microtime
(
TRUE
)
>
$end
)
{
if
(
$condition
!==
FALSE
&&
microtime
(
TRUE
)
>
$end
)
{
throw
new
Behavior
Exception
(
sprintf
(
'Timeout of %d reached when checking on %s'
,
$time
,
$condition
));
throw
new
Exception
(
sprintf
(
'Timeout of %d reached when checking on %s'
,
$time
,
$condition
));
}
}
}
}
...
@@ -1583,60 +1583,4 @@ JS;
...
@@ -1583,60 +1583,4 @@ JS;
return
$element
->
getAttribute
(
$attributeName
);
return
$element
->
getAttribute
(
$attributeName
);
}
}
/**
* Accept Alerts Before going to the next step.
*
* @BeforeStep @AcceptAlertsBeforStep
*/
public
function
beforeStepAcceptAlert
(
BeforeStepScope
$scope
)
{
try
{
$this
->
getSession
()
->
getDriver
()
->
getWebDriverSession
()
->
accept_alert
();
}
catch
(
Exception
$e
)
{
// no-op, alert might not be present.
}
}
/**
* Accept Alerts After going to the next step.
*
* @AftereStep @AcceptAlertsAfterStep
*/
public
function
afterStepAcceptAlert
(
AfterStepScope
$scope
)
{
try
{
$this
->
getSession
()
->
getDriver
()
->
getWebDriverSession
()
->
accept_alert
();
}
catch
(
Exception
$e
)
{
// no-op, alert might not be present.
}
}
/**
* Accept Alerts Before going to the next step.
*
* @BeforeStep @AcceptAlertsBeforStep
*/
public
function
beforeStepDismissAlert
(
BeforeStepScope
$scope
)
{
try
{
$this
->
getSession
()
->
getDriver
()
->
getWebDriverSession
()
->
dismiss_alert
();
}
catch
(
Exception
$e
)
{
// no-op, alert might not be present.
}
}
/**
* Accept Alerts After going to the next step.
*
* @AftereStep @DismissAlertsAfterStep
*/
public
function
afterStepDismissAlert
(
AfterStepScope
$scope
)
{
try
{
$this
->
getSession
()
->
getDriver
()
->
getWebDriverSession
()
->
dismiss_alert
();
}
catch
(
Exception
$e
)
{
// no-op, alert might not be present.
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment