Giter VIP home page Giter VIP logo

sausage's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sausage's Issues

phpunit/phpunit-selenium (1.4.1) is apparently no more?

Hello,
When trying to setup sausage, it would appear that one of it's dependancies is no longer around (phpunit/phpunit-selenium (1.4.1)). The following is the output from the setup process.

tunnel-identifier issue with travis-ci

Travis start sauce_connect with -i argument which have the effect to set a tunnel identifier.
But WebDriverTestCase class don't implement a logic to get the tunnel identifier.

I loose a whole day for it; i will make a pull request

Readme states PHP 5.3+ supported, but unable to get it working in PHP 5.3. Works fine in PHP 5.4

G'day,

Just thought I'd let you know that the readme states PHP 5.3+ is supported. However, I've been unable to get this working. However, it does work fine in PHP 5.4.

Here's the output from PHP 5.3:
[test@centos sauce-tutorial]# vendor/bin/phpunit WebDriverDemo.php
PHP Fatal error: Uncaught exception 'Exception' with message 'No browsers found.' in /test/sauce-tutorial/vendor/sauce/sausage/src/Sauce/Sausage/WebDriverTestCase.php:243
Stack trace:
#0 /test/sauce-tutorial/vendor/sauce/sausage/src/Sauce/Sausage/WebDriverTestCase.php(17): Sauce\Sausage\WebDriverTestCase::browsers()
#1 [internal function]: Sauce\Sausage\WebDriverTestCase::suite('WebDriverDemo')
#2 /test/sauce-tutorial/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(124): ReflectionMethod->invoke(NULL, 'WebDriverDemo')
#3 /test/sauce-tutorial/vendor/phpunit/phpunit/src/TextUI/Command.php(153): PHPUnit_Runner_BaseTestRunner->getTest('WebDriverDemo', '/test/sauce-tut...', Array)
#4 /test/sauce-tutorial/vendor/phpunit/phpunit/src/TextUI/Command.php(132): PHPUnit_TextUI_Command->run(Array, true)
#5 /test/sauce-tutorial/vendor/phpunit/phpunit/phpunit(55): PHPUnit_TextUI_Command::main()
#6 {main}

thrown in /test/sauce-tutorial/vendor/sauce/sausage/src/Sauce/Sausage/WebDriverTestCase.php on line 243

[test@centos sauce-tutorial]# php -v
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.2.1, Copyright (c) 2002-2012, by ionCube Ltd.

Sausage should be compatible with Codeception

I'm currently trying to use Codeception to run selenium tests on Sauce Labs via sausage. To use a corporate word; There would be great synergy if we could get this project as a plugin for Codeception.

For my problem I need to get the SAUCE_USERNAME and SAUCE_ACCESS_KEY available for the WebDriverTestCase class. It doesn't seem to work with the environment variables. Is there a way I can put the information in the code?

How to define different sets of browsers?

One set is meant to be used for quick local tests and the other is for running tests on sauce with a much larger set of OS/browser combinations.

Setting environment variables in phpunit.xml did not do the trick. Because the $browsers array is defined statically and modifying it in the setUp routine is already to late.

Preferrably, the browser configuration is read from the configuration file like the selenium extension does.

Parse error encountered while running Sauce Tests in CircleCi

Following on a composer self-update, and then composer update, I ran my tests at Sauce Cloud using vendor/bin/paratest -p 5 -f /path/to/tests
and things ran fine. Following the commit and push of code,
my Continuous Integration Service (Circle CI) encountered the following error below,
and this error occurs with many php versions suggested via their circle.yml file.

[Exception]
PHP Parse error: syntax error, unexpected T_USE, expecting T_FUNCTION in

vendor/sauce/sausage/src/Sauce/Sausage/WebDriverTestCase.php on line 6

Any ideas? Thanks, Adam.

Set SauceLabs Username and Access Key in Test file

Can the SAUCE_USERNAME and SAUCE_ACCESS_KEY values be set from inside the test itself, instead of being saved in the .sauce_config file? I am trying to build a management system for our tests and our team members have their own Saucelabs accounts.

SSL Certificate problem with CURL & saucelabs (on travis)

Hi,

I keep on getting this while running tests in travis:
Exception: Got an error while making a request: server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
(no sauce connect needed, don't run them locally, I first deploy to a public server and use that as URL for selenium)

Seems to be related to Codeception/Codeception#1649 - there's a fix posted there which adds CURL options (as could be done in sauceapi.php) to ignore certificate validation, but I'm not sure if that is the real issue or if that is a good idea.

Anyone with similar problems? Full stack:

Exception: Got an error while making a request: server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
/home/travis/build/vendor/sauce/sausage/src/Sauce/Sausage/SauceAPI.php:67
/home/travis/build/vendor/sauce/sausage/src/Sauce/Sausage/SauceAPI.php:87
/home/travis/build/vendor/sauce/sausage/src/Sauce/Sausage/SauceTestCommon.php:17
/home/travis/build/vendor/sauce/sausage/src/Sauce/Sausage/SauceTestCommon.php:17
/home/travis/build/vendor/sauce/sausage/src/Sauce/Sausage/TestCase.php:151
phar:///home/travis/.phpenv/versions/5.5.21/bin/phpunit/phpunit/Framework/TestSuite.php:716
phar:///home/travis/.phpenv/versions/5.5.21/bin/phpunit/phpunit/Framework/TestSuite.php:716
phar:///home/travis/.phpenv/versions/5.5.21/bin/phpunit/phpunit/Framework/TestSuite.php:716
phar:///home/travis/.phpenv/versions/5.5.21/bin/phpunit/phpunit/TextUI/TestRunner.php:388
phar:///home/travis/.phpenv/versions/5.5.21/bin/phpunit/phpunit/TextUI/Command.php:151
phar:///home/travis/.phpenv/versions/5.5.21/bin/phpunit/phpunit/TextUI/Command.php:103

Travis config doesn't contain anything unusual, - phpunit tests_acceptance/ as a script and the secure credentials to saucelabs.

Thanks a bunch!

Childs of WebDriverTestCase fail in Chrome and Safari

When using Chrome or Safari to test locally, all simple subclasses of WebDriverTestCase will fail with the following errors:

Safari (locally and against Saucelabs):
PHPUnit_Extensions_Selenium2TestCase_WebDriverException : Invalid command: missing "url" parameter

Chrome (locally only):
PHPUnit_Extensions_Selenium2TestCase_WebDriverException : unknown error: unhandled inspector error: {"code":-32603,"message":"Cannot navigate to invalid URL"}

The root of the problem is in WebDriverTestCase::setUpPage(), which will try to load an empty URL at the start of the test. If I overwrite this method in a child class and use a valid URL, the tests work as expected.

Gist for a demonstration:
https://gist.github.com/toubsen/7642200

Versions used:

  • selenium-server-standalone-2.37.0.jar
  • chrome=31.0.1650.57
  • safari=5.1.7
  • chromedriver=2.7.236900
  • phpunit/phpunit=3.7.28
  • sauce/sausage=v0.9.2

assertTextPresent and page refreshes

Seems to me like there is a problem with the way assertTextPresent is currently implemented. Mainly that it pulls the element outside of the spin:

$element = $this->byCssSelector('body');

The issue with this is say you are submitting a page which will refresh with a validation error, and you are utilizing assertTextPresent to test for the error text. If the above line gets called BEFORE the page refreshes, it will end up pulling the body element of the current page (rather than the refreshed page), and then proceed to throw a StaleElementReferenceException within Selenium Server each time that it attempts to extract the text.

Thinking the simple solution would be to move the element accessor inside of the spin when the method element argument is null. Thoughts?

What's the best way to refactor assertContains to using spinAsserts?

I have a good few assertContains assertions in my code. I want to refactor those to use spinAssert. What's the best way to do this? Should I expand the respective classes in your project to have equivalent spinAssertContains classes?

Or is there a simple way to achieve my goal?

This is more a question than an issue, so sortry if this doesn't belong here.

SeleniumRCDemo.php doesn't work

I've been trying to get a SeleniumRC test working with sauce/sausage, but kept seeing this exception:

exception 'RuntimeException' with message 'Invalid response while accessing the Selenium Server at 'http://ondemand.saucelabs.com:80/selenium-server/driver/': Unknown command'

I thought it was me, but when I try to run the SeleniumRCDemo.php script provided in this lib, I get the exact same message. Here's the URL that PHP is trying to post to:

http://ondemand.saucelabs.com:80/selenium-server/driver/

And it seems to be trying to issue the command "getNewBrowserSession", based on the post data I dumped (the "cmd" argument is "getNewBrowserSession").

Has something changed with Sauce OnDemand that would be denying this command?

BrowserMobProxy Setup

Hi,

I am trying to set up BrowserMob proxy (with PHP) using sauce in local mode and am having an issue. The specific error given is:

"Undefined property: PHPBrowserMobProxy_Client::$port"

I was specifically wondering how to specify the port set up using desired capabilities in my BaseTest class (where I set up browser specifics). Any help would be much appreciated.

Thanks,

Jessica

Travis-ci / Saucelab tests got this error : GnuTLS recv error (-9)

Not every times, but so many times, I got this error from travis-ci tests :
Exception: Got an error while making a request: GnuTLS recv error (-9): A TLS packet with unexpected length was received.

Travis see 'Error' as test result and saucelab keep 'complete' as result instead of 'passed' whereas the test was successfull.

My research tells that a lots of services now use TLS instead of SSL with curl; so i tried to add some custom option like this in Sauce/Sausage/SauceAPI.php :
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
or
curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'TLSv1');

But nothing works.
I will create a ticket on saucelab about this; but I'm surprised to be alone with this problem.
You can see the issue here i you want : https://travis-ci.org/emilient/Easy_MultipleDomains/builds/56311207

BadMethodCallException: The command http://[email protected]:80/wd/hub/session/url is not recognized by the server.

I started to get this BadMethodCallException errors from my tests, and I thought it was something I did wrong but after doing a fresh install, I get the same errors so it doesn't seem to be something on my end.

vendor/bin/paratest -p 8 -f --phpunit=vendor/bin/phpunit WebDriverDemo.php

Running phpunit in 8 processes with vendor/bin/phpunit. Functional mode is on

EEEEEEEE

Time: 2.32 seconds, Memory: 3.75Mb

There were 8 errors:

1) WebDriverDemo::testTitle
Report link: https://saucelabs.com/jobs/?auth=301046ac7f2a72861856e2d3d13fc40f

BadMethodCallException: The command http://[email protected]:80/wd/hub/session/url is not recognized by the server.

/tests/vendor/sauce/sausage/src/Sauce/Sausage/TestCase.php:194
/tests/vendor/sauce/sausage/src/Sauce/Sausage/TestCase.php:194
/tests/vendor/sauce/sausage/src/Sauce/Sausage/TestCase.php:41

...

waitForElementPresent

In my code I have a javascript that adds elements to the DOM and I need a function that waits for the elements to be present. So far I have managed to come up with the following:

$test = $this;
$this->waitUntil(function() use ($test) {
  try {
    $boolean = ($test->byId("element-id") instanceof \PHPUnit_Extensions_Selenium2TestCase_Element);
  } catch (\Exception $e) {
    $boolean = false;
  }
  return $boolean === true ?: null;
});

However, this gives me the following error:

PHPUnit_Extensions_Selenium2TestCase_WebDriverException: Timed out after 0 seconds

Any idea how I can get this to work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.