behatch / contexts Goto Github PK
View Code? Open in Web Editor NEWBehat extension with most custom helper steps
License: Other
Behat extension with most custom helper steps
License: Other
To test command lines tool, I do not need http_call services required in Extension::load
method.
Do you think it is a good idea to add a parameter to allow to skip http_call
loading?
PR is coming if so.
Hello, I get this error
Catchable Fatal Error: Object of class stdClass could not be converted to string in vendor\sanpi\behatch-contexts\src\Sanpi\Behatch\Context\JsonContext.php line 129
when I try to parse JSON responce with
And the JSON node "root.errors" should not exist
My JSON response looks like
{
"code":400,
"message":"Validation Failed",
"errors":
{"children":
{"id":[],"firstName":[],"lastName":[],"username":[],"email":{"errors":["..."]}
}
}
}
So, by this code
try {
$actual = $this->evaluateJson($json, $node);
}
catch (\Exception $e) {
}
if ($e === null) {
throw new \Exception(sprintf("The node '%s' exists and contains '%s'.", $node , $actual));
}
we got at $actual var node tree "errors", and later you try to convert stdClass to string at Exception text.
so the simplest way to fix this is wrap $actual with print_r like this print_r($actual,true)
This exception appear at some other rows.
Thank you, and excuse me for my english.
Hello,
Im trying to make a scenario where I first have to do some drupal things (with the drupal extension for behat) and after that check the output of a json call.
The problem is that I need a browser for the drupal things and then the call doesnt get validated as correct json in the browser (ff, chrome, ie,...)
Anybody a solution?
I'm trying to set a header before sending a request and an exception is thrown.
PHP Fatal error: Call to undefined method Symfony\Component\HttpKernel\Client::setHeader() in /Users/richard/…/vendor/behatch/contexts/src/HttpCall/Request.php on line 51
Heres a snippet from the scenario:
And I add "Content-Type" header equal to "application/json"
When I send a POST request to "/path" with body:
…
Could it be possible to pass private properties and methods from private to protected so that we can inherit of those contexts?
According to http://docs.behat.org/guides/2.definitions.html#transforming-tables table nodes are matched like so /^table:name,followers$/
Problem is because behatch uses tables the 'wrong' way round (rows are columns and columns are rows) in steps such as fill in the following, you get row data in the match string instead of field names.
Guess there is not much option but to use tables correctly although I do prefer the way it looks in a story when using the current way...
Wrong (current) way:
And fill in the following:
| New Password | newpassword |
| Confirm Password | newpassword |
Right way:
And fill in the following:
| New Password | Confirm Password |
| newpassword | newpassword |
There is a bug in detection of false value.
I have a step: And the JSON node "is_completed" should be equal to "false"
and I'm getting this error: The node value is 'false' (Exception)
I tried And the JSON node "is_completed" should contain "false"
as well but it is not working either.
True value works fine.
Because 2.0
https://packagist.org/packages/sanpi/behatch-contexts needs a @dev
dependency.
Hi,
a recent RawMinkContext have break RestContext
Fatal error: Access level to Sanpi\Behatch\Context\RestContext::locatePath() must be public (as in class Behat\MinkExtension\Con\Context\RawMinkContext) in vendor/sanpi/behatch-contexts/src/Sanpi/Behatch/Context/RestContext\RawMinkContext) in /home/jenkins/jobs/Trinity/workspace/vendor/sanpi/behatch-contexts/src/Sanpi/Behatch/Context/RestContexntext.php on line 164
Changing visibility correct the problem.
Thanks
Xavier
For example Behat\Behat\Context\Step\Given deleted in Behat/Behat@0cce535
and Behat\Behat\Definition\Callee\Given appears in Behat/Behat@079c2d6
Did not have 🕐 to fix this yet 😄
See https://github.com/tophsic/behatch-contexts/tree/fix-given-then
Example: iSendARequestToWithBody
Given I add "Content-Type" header equal to "application/json"
When I send a "POST" request to "api.json" with body:
Actual sent header in this scenario:
Content-Type: application/x-www-form-urlencoded
I need to test that a JSON array contains an object node with a particular ID and that that object node has a particular value in one of its fields.
This could be worded as such:
@Then the JSON object :node_path in the JSON array :array_path having a member node :lookup_node equal to :lookup_value has another member :expected_name equal to :expected_value
Ok, travis back to green, now we can work on the big issue with Behat/Symfony2Extension (#55, #98, #101, #110 and #118).
All issues is in the rest context, this confirms @stof’s comment:
The rest-context is a huge mistake altogether. Mink is not a REST client (browsers are not REST clients either). There is no point using the Mink driver to perform the REST API calls. It is the wrong tool for the job.
Any idea?
It seems that some tags have been silently removed (2.3 and recently 2.2). It breaks our projects requiring Behatch (errors like The requested package behatch/contexts could not be found in any version, there may be a typo in the package name.
while running composer update
), it breaks semver and it is against best practices.
Having looked through the source, I found this within the RSS2.0 XSD being used:
<xs:element name="item" type="RssItem" minOccurs="1" maxOccurs="unbounded">
<!--
HACK: According to the RSS 2.0 spec, it should strictly be possible to have zero item elements,
but this makes the schema non-deterministic with regard to extensibility elements
so for the moment we undid bug-fix 10231 and set minOccurs=1 to work around this problem.
-->
</xs:element>
The minOccurs=1 is causing some of my tests to fail when they should not.
This step works only with the content-type header, the others are array values.
On the RestContext, we need to add quotes on the following to steps around the method name:
If we do not do it, behat does not catch it is a parameter. Correct me if I am wrong.
It would be nice to have a step to assert the reason phrase, like we have for status code. When I get 200 response, I would like also to check the reason phrase is "OK".
Currently, using the BrowserContext will always force stopping the session at the end of the scenario because of https://github.com/sanpii/behatch-contexts/blob/67de9a82d08e7355628b8d1a707bddec13f945f2/src/Context/BrowserContext.php#L21
But this is a bad idea:
I don't know why you force isolating each scenario entirely (MinkExtension already provides a way to do it for scenarios needing it to work btw), but it should not be forced by default for anyone using your context (it is not even documented)
Hi,
I cloned dev-master however when I use step "I save a screenshot in "index.png"", I get the error below
Fatal error: Call to undefined method Behat\Mink\Session::getScreenshot() in C:\
htdocs\myproject\vendor\behat\mink-extension\src\Behat\MinkExtension\Context\RawM
inkContext.php on line 125
My composer looks like:
"behat/behat": "2.4.*@stable",
"behat/mink": "1.4@stable",
"behat/mink-selenium2-driver": "*",
"behat/mink-extension": "*",
"sanpi/behatch-contexts": "dev-master"
Am I missing something? or Is it bug? I am using selenium2-driver
Does it support php7? "php":"~5.4" doesn't allow installing this with php7
You can simplify things even further in 3.0:
ClassResolver
, you can simplify contexts referencingBasically, those things put together will allow you to do something like this:
default:
suites:
core:
contexts:
behatch:debug:
screenshotDir: '/tmp'
behatch:debug
will be resolved to Sanpi\Behatch\Context\DebugContext
via your custom ClassResolver
. Then screenshotDir
will be passed to it as a simple constructor argument (matching by name).
From feature/rest.feature
the header "Content-Type" should be equal to "text/html; charset=utf-8"
The above results in:
And the header "Content-Type" should be equal to "text/html; charset=utf-8" # Sanpi\Behatch\Context\RestContext::theHeaderShouldBeEqualTo()
The header "Content-Type" is equal to "text/html; charset=UTF-8" (Behat\Mink\Exception\ExpectationException)
https://github.com/sanpii/behatch-contexts/blob/master/src/HttpCall/HttpCallListener.php#L57
mink throws DriverException which not inherited from LogicException, so tests failing.
I'am using Mink with BrowserKit.
Using the following feature:
Feature: Listing sports
Scenario: Successful listing of seeded sports # features/functional/sports/index.feature:3
Given I add "Accept" header equal to "application/json" # Sanpi\Behatch\Context\RestContext::iAddHeaderEqualTo()
And I add "Content-type" header equal to "application/json" # Sanpi\Behatch\Context\RestContext::iAddHeaderEqualTo()
When I send a GET request to "/sports"
Using TCPdump to see what is actually being sent:
GET /sports HTTP/1.1
Host: test.apisportsdata.sportlobster.dev
User-Agent: Symfony2 BrowserKit
None of the headers I have specified are actually sent.
Composer:
"require-dev": {
"behat/behat": "~3.0",
"behat/mink-goutte-driver": "~1.1",
"behatch/contexts": "dev-master",
"phpspec/phpspec": "~2.0",
"phpunit/phpunit": "~4.1",
"way/generators": "2.*"
},
Behat.yml:
default:
extensions:
Behat\MinkExtension:
base_url: 'http://localhost'
default_session: goutte
goutte: ~
Sanpi\Behatch\Extension: ~
suites:
functional:
paths: [ %paths.base%/features/functional ]
contexts:
- LaravelFeatureContext
- Behat\MinkExtension\Context\MinkContext
- behatch:browser
- behatch:debug
- behatch:system
- behatch:json:
evaluationMode: javascript
- behatch:table
- behatch:rest
- behatch:xml
[RuntimeException]
Error Output: PHP Fatal error: Call to undefined method Symfony\Component\HttpFoundation\Request::getServer() in /Users/Theo/Sites/CDJE/Incipio/vendor/behatch/contexts/src/Context/RestContext.php on line 2
24
Tested with Symfony 2.7 BETA.
Hi,
When there is an element with default namespace that doesn't have a prefix, XMLContext.php
can not find it. This is a bug in xpath itself when there is no prefix. Check the first answer:
XPath in SimpleXML for default namespaces
So I have xml similar to the the following:
<?xml version="1.0" encoding="UTF-8"?>
<University>
<ContactInformation>
<Name>University Name</Name>
<Address>University Address</Address>
</ContactInformation>
<body>
<Colleges xmlns="http://ws.someuni.com/ver1">
<Entries countEntries="4">
<college name="college1"/>
<college name="college2"/>
<college name="college3"/>
<college name="college4"/>
</Entries>
</Colleges>
</body>
</University>
If I try to get countEntries
attribute or Entries
element using behatch context, it will not return anything.
I have tried to use rootns
as default namespace but that didn't work either.
I made a fix to this issue by adding namespace(s) with counters inside getNamesapces
method.
// file = Sanpi\Behatch\Context\XmlContext
private function getNamespaces(\DOMDocument $dom = null)
{
$xml = $this->getSimpleXml($dom);
$namespaces = $xml->getNamespaces(true);
// fix
$counter = 0;
foreach($namespaces as $key => $value ){
if(empty($key)) {
$counter++;
$correctedNamespaces['ns'.$counter] = $value;
} else {
$correctedNamespaces[$key] = $value;
}
}
return $correctedNamespaces;
}
Then to get countEntries
you can use the following phrase:
Then the XML attribute "countEntries" on element "//University/body/ns1:Colleges/ns1:Entries" should be equal to "4"
I am updating my composer packages but I get the following error when I get to behatch-context package:
- Updating sanpi/behatch-contexts dev-master (044ce4d => 876e1c8)
Checking out 876e1c8e86a7dc4dadb54fcdbd821a1ce9846741
[RuntimeException]
Failed to execute git checkout '876e1c8e86a7dc4dadb54fcdbd821a1ce9846741' && git reset --hard '876e1c8e86a7dc4dadb54fcdbd821a1ce9846741'
fatal: reference is not a tree: 876e1c8e86a7dc4dadb54fcdbd821a1ce9846741
Any idea what might be the reason?
When I follow "Delete"
Then I should see "Are you sure?" in popup
When I confirm the popup
It causes an UnexpectedAlertOpen
exception after the When I follow "Delete"
! The patch of @madalinoprea is causes error ( #94 ):
No alert is present (WARNING: The server did not provide any stacktrace information)
The whole httpCallResultPool
concept seems wrong, the source call (get the content) to Selenium causes error some cases (like javascript alert or confirm)!
I tried to use the following step definition:
/^(?:|I )shoud see the "(?P[^"]*)" parameter$/
Scenario:
Given I am on "/browser/auth.php?logout"
Then I shoud see the "logout" parameter
And I get a fatal error:
Fatal error: Call to undefined method FeatureContext::getParameter() in ./tests/behat/vendor/sanpi/behatch-contexts/src/Sanpi/Behatch/Context/BrowserContext.php on line 272
Call Stack:
0.0032 639416 1. {main}() ./tests/behat/vendor/behat/behat/bin/behat:0
0.0393 2461432 2. Symfony\Component\Console\Application->run() ./tests/behat/vendor/behat/behat/bin/behat:32
0.0540 3087808 3. Behat\Behat\Console\BehatApplication->doRun() ./tests/behat/vendor/symfony/console/Symfony/Component/Console/Application.php:106
0.8009 15976472 4. Symfony\Component\Console\Application->doRun() ./tests/behat/vendor/behat/behat/src/Behat/Behat/Console/BehatApplication.php:68
0.8015 15976608 5. Symfony\Component\Console\Command\Command->run() ./tests/behat/vendor/symfony/console/Symfony/Component/Console/Application.php:193
1.1383 21343000 6. Behat\Behat\Console\Command\BehatCommand->execute() ./tests/behat/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:240
1.1396 21361776 7. Behat\Behat\Console\Command\BehatCommand->runFeatures() ./tests/behat/vendor/behat/behat/src/Behat/Behat/Console/Command/BehatCommand.php:128
1.1761 21776368 8. Behat\Gherkin\Node\AbstractNode->accept() ./tests/behat/vendor/behat/behat/src/Behat/Behat/Console/Command/BehatCommand.php:150
1.1761 21776368 9. Behat\Behat\Tester\FeatureTester->visit() ./tests/behat/vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractNode.php:42
1.1848 21925904 10. Behat\Gherkin\Node\AbstractNode->accept() ./tests/behat/vendor/behat/behat/src/Behat/Behat/Tester/FeatureTester.php:88
1.1848 21925904 11. Behat\Behat\Tester\ScenarioTester->visit() ./tests/behat/vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractNode.php:42
10.9499 22973640 12. Behat\Behat\Tester\ScenarioTester->visitStep() ./tests/behat/vendor/behat/behat/src/Behat/Behat/Tester/ScenarioTester.php:87
10.9518 22975320 13. Behat\Gherkin\Node\AbstractNode->accept() ./tests/behat/vendor/behat/behat/src/Behat/Behat/Tester/ScenarioTester.php:148
10.9518 22975320 14. Behat\Behat\Tester\StepTester->visit() ./tests/behat/vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractNode.php:42
10.9521 22975320 15. Behat\Behat\Tester\StepTester->executeStep() ./tests/behat/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php:95
10.9688 22976136 16. Behat\Behat\Tester\StepTester->executeStepDefinition() ./tests/behat/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php:126
10.9689 22976136 17. Behat\Behat\Definition\Annotation\Definition->run() ./tests/behat/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php:157
10.9691 22977544 18. call_user_func_array() ./tests/behat/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Definition.php:155
10.9691 22978032 19. Sanpi\Behatch\Context\BrowserContext->iShouldSeeTheParameter() ./tests/behat/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Definition.php:0
The step is defined in Sanpi\Behatch\Context\BrowserContext::iShouldSeeTheParameter() and the error comes from this line:
$this->getMainContext()->getParameter($parameter)
During testing some CRUD listing pages, I only want to test some cells, not all of them.
I want to test only the data cells.
Because most of the time the last cell is a list of action links.
From the original fixtures/www/table/index.html
fixture file, I want the following scenario to be valid.
Scenario: Partial Testing rows
Given I am on "/table/index.html"
And the data in the 1st row of the "table" table should match:
| col1 |
| Lorem |
Hi,
When I use contexts : behatch:json
or behatch:rest
I got :
[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: preg_match() expects parameter 2 to be string, object given
As soon as I remove them, the error disappear.
Has the documentation some step missing ?
Using Behat 3+ :
"behat/behat": "3.0.*@dev",
"behat/symfony2-extension": "dev-master",
"behat/mink-extension": "2.0.*@dev",
"behat/common-contexts": "1.2.*@dev",
"sensiolabs/behat-page-object-extension": "2.0.*@dev",
"vipsoft/doctrine-data-fixtures-extension": "3.0.*@dev",
"behatch/contexts": "dev-master",
"behat/mink": "dev-master",
"behat/mink-browserkit-driver": "dev-master",
"behat/mink-goutte-driver": "dev-master",
"behat/mink-selenium2-driver": "1.2.*@dev",
"behat/web-api-extension": "1.0.*@dev"
with configuration :
default:
autoload: %paths.base%/features/Context
extensions:
Behat\MinkExtension:
base_url: http://xxx.xxxx.dev/app_test.php/
files_path: app/features/files
default_session: goutte
javascript_session: selenium2
goutte: ~
selenium2: ~
Behat\Symfony2Extension:
kernel:
env: test
debug: true
VIPSoft\DoctrineDataFixturesExtension\Extension:
lifetime: feature
autoload: false
directories:
- app/features/Context/Fixtures
fixtures: ~
migrations: ~
Behat\WebApiExtension:
base_url: http://xxx.xxx.dev/app_test.php/
Sanpi\Behatch\Extension: ~
suites:
default:
contexts:
- Context\FeatureContext
- Behat\WebApiExtension\Context\WebApiContext
- behatch:table
- behatch:json
- behatch:rest
translation:
locale: en
Did I miss something or tag 2.3 was removed ? I miss it 😢
On some older code I've noticed that 'stale element reference: element is not attached to the page document' exceptions were raised by iWaitSecondsUntilISeeInTheElement.
Was there any work done recently for this issue?
My solution to this problem was to overwrite iWaitSecondsUntilISeeInTheElement with this implementation. But if this is not a current issue then I'm not going to commit it:
/**
* Checks, that the element contains specified text after timeout
* Overwrites base class to try to fix "stale element reference: element is not attached to the page document" errors
*
* Parent method was caching the element
*/
public function iWaitSecondsUntilISeeInTheElement($seconds, $text, $element)
{
$expected = str_replace('\\"', '"', $text);
$startTime = time();
do {
$now = time();
if (is_string($element)) {
$node = $this->getSession()->getPage()->find('css', $element);
}
else {
$node = $element;
}
$exception = null;
try {
$actual = $node->getText();
$this->assertContains($expected, $actual);
}
catch (Exception $e) {
$exception = $e;
if ($now - $startTime >= $seconds) {
$message = sprintf('The text "%s" was not found after a %s seconds timeout', $expected, $seconds);
throw new ResponseTextException($message, $this->getSession(), $e);
}
}
if ($exception == null) {
break;
}
usleep(200);
} while ($now - $startTime < $seconds);
}
Looks like behatch uses its own assert functions (assertContains, assertNotContains), would it be possible for it to be refactored to use the WebAssert versions? I have overridden these to do exact matching and need the behatch steps to use the same logic.
Attempting to run this scenario:
Feature: Creating new sports
Scenario: Successful creation
Given I add "Accept" header equal to "application/json"
With no other steps, I get this exception:
Feature: Creating new sports
Scenario: Successful creation # features/functional/sports/store.feature:3
Given I add "Accept" header equal to "application/json" # Sanpi\Behatch\Context\RestContext::iAddHeaderEqualTo()
[Behat\Mink\Exception\DriverException]
Unable to access the response before visiting a page
So for some reason I'm getting an exception when trying to set up headers prior to sending the request - it seems like its trying to access the response for some reason. I've been scratching my head over this for a while, can't see what I'm doing wrong.
To prevent conflit with Behatch/notifiers class alias (behatch:notifier
).
BC.
//Follows XPath element
//TODO: Fix this function
/**
* THIS FUNCTION IS CURRENTLY DEPRECATED AND NEEDS TLC
* Click on the nth specified link
* Example: When I click on 1st "ul li a" link
* Example: And I click on 6th "ul li a" link
*
* @When (I )follow the :index :link link
*/
public function iFollowTheNthLink($index, $link)
{
$page = $this->getSession()->getPage();
$links = $page->findAll('named', [
'link', $this->getSession()->getSelectorsHandler()->xpathLiteral($link)
]);
if (!isset($links[$index - 1])) {
throw new \Exception("The $index element '$link' was not found anywhere in the page");
}
$links[$index - 1]->click();
}
The above function doesnt work. To reproduce use the step definition in any test. Error suggests not using xpathLiteral as it is deprecated.
this function in RestContext
public function iAddHeaderEqualTo($name, $value)
{
$this->getSession()->getDriver()->getClient()->setServerParameter($name, $value);
}
sets the server parameters not request headers, so you have to write
I add "CONTENT_TYPE" header equal to "application/json"
instead of
I add "Content-Type" header equal to "application/json"
Do you think it is a good idea to display output if a test fail using SystemContext
? I have trouble to debug un Travis build because I just have this log:
Then command should succeed # Sanpi\Behatch\Context\SystemContext::commandShouldSucceed()
exception 'Exception' with message 'Command should succeed 1' in vendor/behatch/contexts/src/Context/SystemContext.php:73
I can implement also a debug output
action.
What do you think?
Hello,
Can you tag a new version with the Symfony 3 support ?
Hi,
When I use contexts : behatch:json
or behatch:rest
I got :
[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: preg_match() expects parameter 2 to be string, object given
As soon as I remove them, the error disappear.
Has the documentation some step missing ?
Using Behat 3+, tried with SF 2.6.3
and 2.6.1
:
"behat/behat": "3.0.*@dev",
"behat/symfony2-extension": "dev-master",
"behat/mink-extension": "2.0.*@dev",
"behat/common-contexts": "1.2.*@dev",
"sensiolabs/behat-page-object-extension": "2.0.*@dev",
"vipsoft/doctrine-data-fixtures-extension": "3.0.*@dev",
"behatch/contexts": "dev-master",
"behat/mink": "dev-master",
"behat/mink-browserkit-driver": "dev-master",
"behat/mink-goutte-driver": "dev-master",
"behat/mink-selenium2-driver": "1.2.*@dev",
"behat/web-api-extension": "1.0.*@dev"
with configuration :
default:
autoload: %paths.base%/features/Context
extensions:
Behat\MinkExtension:
base_url: http://xxx.xxxx.dev/app_test.php/
files_path: app/features/files
default_session: goutte
javascript_session: selenium2
goutte: ~
selenium2: ~
Behat\Symfony2Extension:
kernel:
env: test
debug: true
VIPSoft\DoctrineDataFixturesExtension\Extension:
lifetime: feature
autoload: false
directories:
- app/features/Context/Fixtures
fixtures: ~
migrations: ~
Behat\WebApiExtension:
base_url: http://xxx.xxx.dev/app_test.php/
Sanpi\Behatch\Extension: ~
suites:
default:
contexts:
- Context\FeatureContext
- Behat\WebApiExtension\Context\WebApiContext
- behatch:json
- behatch:rest
translation:
locale: en
BC.
This is my documents.json file content:
{
"$schema": "http://json-schema.org/draft-04/schema",
"type": "array",
"required": true,
"items": {
"$ref": "document.json",
"required": true
}
}
And this is my document.json file content:
{
"$schema": "http://json-schema.org/draft-04/schema",
"type": "object",
"required": true,
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"required": true
},
"inexistent_property": {
"type": "string",
"required": true
}
}
}
When I pass this json response:
[
{
"id": "an_id"
}
]
It passes the tests.
I'm doing something wrong?
In the BaseContext.php we have:
protected function assertTrue($value, $message = null)
{
if ($value) {
if (is_null($message)) {
$message = sprintf('The value is true');
}
throw new ExpectationException($message, $this->getSession());
}
}
protected function assertFalse($value, $message = null)
{
if (!$value) {
if (is_null($message)) {
$message = sprintf('The value is false');
}
throw new ExpectationException($message, $this->getSession());
}
}
I think there is a bug, the first if condition should be true !== $value for assertTrue and false !== $value in the assertFalse method. Take for instance the assertFalse when $value is false, !$value will be true and the exception will be thrown.
I want to open contribution for behatch, there is no reason I am the only one who can approve contributions.
Planned actions:
Sanpi\Behatch\Context
-> Behatch\Context
(in 3.x branch)PHP Fatal error: Call to undefined method Symfony\Component\HttpFoundation\Request::getServer() in vendor/sanpi/behatch-contexts/src/Context/RestContext.php on line 224
Feature: "print the corresponding curl command"
Hello,
As some driver can take remote sceenshots (eg webdriver with firefox) it would be cool to get screenshots from remote servers (I may use it when I test my projects against a selenium grid)
Maybe a settingun behat.yml under debug like "remote: true"?
Cheers
I've encountered a problem that rises when Behatch is used with drivers other than Goutte.
Namely, when in e.g. RestContext there's a call:
$this->getSession()->getDriver()->getClient()
the problem here is that getDriver() returns an instance of a DriverInterface. But DriverInterface does not specify getClient() method. Actually, getClient() method is defined in BrowserKitDriver. Thus, Behatch doesn't mind working with Selenium2, Zombie etc., but it actually can't properly work with them, as they only extend CoreDriver, while it works ok with Goutte (which is instance of BrowserKit).
I guess you should either define that you expect $this->getSession()->getDriver() returns instance of BrowserKit, or add support for true DriverInterface.
https://github.com/sanpii/behatch-contexts/compare/better-timeout
Do you think this commit is an improvement/necessary?
Php 5.4 allow some improvements:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.