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
3c284d4b
Commit
3c284d4b
authored
7 years ago
by
Rajab Natshah
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2888454
: Betterd up the Behat VarbaseContext
parent
68393a14
No related branches found
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
+55
-51
55 additions, 51 deletions
tests/features/bootstrap/VarbaseContext.php
with
55 additions
and
51 deletions
tests/features/bootstrap/VarbaseContext.php
+
55
−
51
View file @
3c284d4b
...
@@ -1340,6 +1340,61 @@ JS;
...
@@ -1340,6 +1340,61 @@ JS;
throw
new
\Exception
(
"No label with the value of for='"
.
$value
.
"' radio button not found."
);
throw
new
\Exception
(
"No label with the value of for='"
.
$value
.
"' radio button not found."
);
}
}
}
}
/**
* #varbase: To expand a field group by its id attribute.
*
* Example 1: I Expand the field "Field Group ID"
* @When I Expand the field :arg1
*
* @param $text
* @throws \InvalidArgumentException
*/
public
function
iExpandThefield
(
$fieldID
)
{
$js
=
<<<JS
var group = document.getElementById("{$fieldID}");
group.setAttribute("open","");
JS;
$this
->
getSession
()
->
executeScript
(
$js
);
}
/**
* #varbase: To expand a select list by it's class attribute.
*
* @When I Expand the select list :arg1
*
* @param $text
* @throws \InvalidArgumentException
*/
public
function
iExpandTheSelectList
(
$listClassName
)
{
$js
=
<<<JS
var group = document.getElementsByClassName("{$listClassName}")[0];
group.className += "open";
JS;
$this
->
getSession
()
->
executeScript
(
$js
);
}
/**
* #varbase: To scroll down in the current status of the page.
*
* @When I scrolldown
*/
public
function
iScrolldown
()
{
$this
->
getSession
()
->
executeScript
(
"javascript:window.scrollBy(200,350)"
);
}
/**
* #varbase: To check if the Image media browser opened.
*
* Example : Then the image media browser should be open
*
* @Then /^the image media browser should be open$/
*/
public
function
theImageMediaBrowserIsOpen
()
{
if
(
!
$elem
=
$this
->
getSession
()
->
getPage
()
->
find
(
'css'
,
'.ui-dialog.ui-widget-content'
))
{
throw
new
Exception
(
'The image media browser failed to open.'
);
}
}
public
function
cleanUsers
()
{
public
function
cleanUsers
()
{
...
@@ -1389,57 +1444,6 @@ JS;
...
@@ -1389,57 +1444,6 @@ JS;
}
}
}
}
/**
* To expand a field group by adding open attribute.
*
* Example 1: I Expand the field
* @When I Expand the field :arg1
*
* @param $text
* @throws \InvalidArgumentException
*/
public
function
iExpandThefield
(
$fieldID
)
{
$js
=
<<<JS
var group = document.getElementById("{$fieldID}");
group.setAttribute("open","");
JS;
$this
->
getSession
()
->
executeScript
(
$js
);
}
/**
* @When I Expand the select list :arg1
*
* @param $text
* @throws \InvalidArgumentException
*/
public
function
iExpandTheSelectList
(
$listClassName
)
{
$js
=
<<<JS
var group = document.getElementsByClassName("{$listClassName}")[0];
group.className += "open";
JS;
$this
->
getSession
()
->
executeScript
(
$js
);
}
/**
* @Then I scrolldown
*/
public
function
iScrolldown
()
{
$this
->
getSession
()
->
executeScript
(
"javascript:window.scrollBy(200,350)"
);
}
/**
* To check if the Image media browser opened.
*
* Example : Then the image media browser should be open
*
* @Then /^the image media browser should be open$/
*/
public
function
theImageMediaBrowserIsOpen
()
{
if
(
!
$elem
=
$this
->
getSession
()
->
getPage
()
->
find
(
'css'
,
'.ui-dialog.ui-widget-content'
))
{
throw
new
Exception
(
'The image media browser failed to open.'
);
}
}
/**
/**
* Maximize the window before scenario.
* Maximize the window before scenario.
*
*
...
...
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