mink

How to switch to dynamically named iframe with Behat/Mink

ε祈祈猫儿з 提交于 2019-12-12 15:06:19
问题 Writing test for an iFrame generated when a button is clicked. The iFrame name and id are similar but generated dynamically. I have used "switchToiFrame" successfully before. <div class="bbbb-frame-container" style="height: 400px; width: 665px; margin-top: -200px; margin-left: -332.5px;"> <div class="user-support-frame-close-container" style="display: block;"> <div class="user-support-frame-close">Close</div> </div> <iframe id="poplock_default9636_priv" frameborder="0" name="poplock

How can I tell selenium webserver standalone which firefox version to use?

情到浓时终转凉″ 提交于 2019-12-12 04:23:23
问题 Usually I start my selenium server like this: java -jar -Dwebdriver.firefox.profile=MyProfile /usr/local/bin/selenium-server-standalone-3.0.1.jar My programming language is php, so I use mink in which I initialize the Selenium2Driver. By executin my phpunit tests everything works fine, my firefox is started and all the tests run as they should. But selenium always starts my installed firefox version. How can I start a standalone version? Is there a parameter telling selenium which firefox to

Accept browser permission dialog with behat/mink

谁说我不能喝 提交于 2019-12-12 00:43:45
问题 I'm using Behat with Mink. Currently I'm working on building a test for webrtc. The issue is that webrtc has a browser permission dialog where the user has to select that they do want to share their media. As this permission is from the browser itself instead of html I don't know how to accept it with mink or even if that's possible. Is there any work around or standard solution for this? I imagine the same issue holds true for anything a browser requires user permissions to use. 回答1: Option

bin/behat @FootballTeamBundle is fine but bin/phing is not for running FeatureContext

前提是你 提交于 2019-12-11 23:00:17
问题 If I use bin/behat @FootballTeamBundle in terminal as stand-alone, the error screen-shots are taken and saved under build/behat/ folder which is fine however, if I run bin/phing then the FeatureContext file seems to be ignored as a whole so neither screen-shots taken nor its internal methods are being triggered (such as I wait for ** seconds) which is strange. Anyone know the solution to it? I also updated the line to bin/behat -f progress --format html --out ${dir-report}/behat.html to bin

Preventing user login method running every single time after first login

风流意气都作罢 提交于 2019-12-11 20:34:44
问题 I'm trying to find a way to create a session/cookie to handle user login so that the method below doesn't run query against the database every singe time. It is being called in nearly all the scenarios and slows the test suite a lot. Important note: There are 2 different users login: user and admin so there may be three different sessions. When I login as "user" When I login as "admin" class FeatureContext extends MinkContext implements KernelAwareInterface { /** * @When /^I login as "([^"]*)

Behat (+ Mink) Check for some text followed by some text (in sibling elements)

不打扰是莪最后的温柔 提交于 2019-12-11 14:11:55
问题 The I should see... function is an essential feature of Behat but I regularly find myself wanting to write something like this in my scenarios: Then I should see "Session ID" followed by "3" Which is my humanly-parsable way of describing 2 pieces of text next to each other in the content. That is to say the first string is the content of any element and the second is the content of it's next immediate sibling. This would be useful for checking label - value type layouts: Or if I want to check

PHP Mink/Zombie - page visit returns status code 0?

孤街浪徒 提交于 2019-12-11 12:17:53
问题 I am supposed to test a login at a server, not under my control, which is HTTPS, using Mink and Zombie driver in PHP. The problem is that I mostly get status code 0 whenever I visit the login page, and thus I cannot work with any of the elements. I've tried using Wireshark to inspect the network traffic - but since it's HTTPS, it's encrypted, and I have no idea what is going on in the Wireshark captures; I can only see some data has been exchanged with the server. I cannot share the URL to

Mink with Selenium2: follow all redirects

流过昼夜 提交于 2019-12-11 10:45:16
问题 How to force Selenium2 to follow all redirects before doing some asserts? Scenario: Guest member can pay with card When I go to "/test" #test page redirects to "/auth" which then redirects to "/main" Then I should be redirected to "/main" I figured that I could simply wait: /** * @Then /^I should be redirected to "([^"]*)"$/ */ public function assertRedirect($url) { $this->getSession()->wait(10000); $this->assertPageAddress($url); } The problem is that however long I wait, I always end up on

Behat/Mink/Selenium2 element is not visible

旧城冷巷雨未停 提交于 2019-12-11 09:38:36
问题 I'm writing my tests with behat and I'm facing a problem when I try to call fillField on a input inside a bootstrap modal. When I send fillField in this input selenium throws an exception saying: Element is not currently visible and so may not be interacted with I've created a selenium (via selenium IDE) test manually and called type on the same field and it worked fine. $page = $this->getSession()->getPage() $page->fillField("id_item", $value); The $value is a parameter from my test. I've

Behat run again a scenario programmatically

非 Y 不嫁゛ 提交于 2019-12-11 07:18:54
问题 After a question on stackoverflow Parameters in Behat 3 Ian found a solution for pass to behat parameters. For environment it's ok, but for country parameters I'm a bit confused. I have a feature like this : Scenario Outline: Test if first link works Given I am on website "<country>" Then I visit the url "my-url" Then I click on first link Examples: | country | | US | | IT | This is what I have, and now I want to run something like : env="stg" country="US,IT" php53 bin/behat --suite=mySuite