okay, i'm setup appium 1.6.3 server on my mac, webdriver agent inspector works great on real device. now i have this config in codeception yml file:
actor: AcceptanceTester
modules:
enabled:
- \Helper\Acceptance
- \Appium\AppiumDriver:
host: 0.0.0.0
port: 4723
dummyRemote: false
resetAfterSuite: true
resetAfterCest: false
resetAfterTest: false
resetAfterStep: false
capabilities:
app : '/Users/kirill/Documents/iCanDeliver/Deliver.app'
platformName : 'ios'
platformVersion : '10.3'
deviceName : 'iPhone (Kirill)'
automationName : 'XCUITest'
udid: c57bcfcc08ee2485d02f30298dc98bef808a39a5
when I concept run any script appium server unlock the real device, deploy app, deploy webdriveragent, connect to webdriveragent, starting app OK,
but how to writing cases? maybe I made something wrong, there is no any info about codeception-webdriveragent.
Thanks!
Related
everyone!
I have been trying to configure Codeception 2.3.6 with Laravel 5.3.30 running on PHP 7.0.23 powered by WAMP 3.1.0. My functional test cases are running fine, but when I try to run my acceptance test cases, a new chrome window opens and then closes without doing anything.
The output in the HTML Report is Codeception Results OK(0s), while the output on the command line is:
WelcomeCept: Perform actions and see result (0.00s)
Time: 3.24 seconds, Memory: 22.75MB
OK (1 test, 0 assertions)
HTML report generated in file://D:\wamp\www\myApp\tests/_output\report.html
First I start ChromeDriver with the command
chromedriver --url-base=/wd/hub
Then I start Selenium Standalone Server 3.13.0 with the command:
java -Dwebdriver.chrome.driver="chromedriver" -jar selenium-server-standalone-3.13.0.jar -port 4445
Then I run my acceptance test suite which contains a single test file, with the command:
call vendor/bin/codecept run acceptance --html
My acceptance.suite.yml is:
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: http://lcms.com/
window_size: false # disabled in ChromeDriver
port: 9515
browser: 'chrome'
restart: true
wait: 200
capabilities:
unexpectedAlertBehaviour: 'accept'
webStorageEnabled: true
javascriptEnabled: true
- Laravel5:
part: ORM
cleanup: false # can't wrap into transaction
environment_file: .env
- \Helper\Acceptance
My WelcomeCept.php file, just for testing the configuration, is:
<?php
class WelcomeCept
{
public function welcomeTest(AcceptanceTester $I)
{
$I->wantTo('perform actions and see result');
}
}
Please review my workflow and let me know if I'm doing things incorrectly or am missing something.
Thanks!
Update: Same thing is happening using GeckoDriver or PhantomJS in WebDriver mode. The tests are passing with OK but not performing any actions.
Solved! I tried WelcomeCest instead of WelcomeCept and things have fallen into place.
I am writing acceptance codeception tests on a web application. It will require me to check headers, specifically response codes. I have found that the codeception REST module can be used, but it appears to require phpbrowser. I am required though to use browserstack. How would the configuration look using browserstack as aposed to phpbrowser.
My acceptance.suite.yml is currently set up like:
chrome-dev:
modules:
enabled:
- WebDriver
- \Helper\
config:
WebDriver:
url: 'https://XXXXXXXXXXXXXXXXXX.com'
host: 'XXXXXXXX#XXXXXXXX.com:XXXXXXXXXX.browserstack.com'
port: 80
browser: 'chrome'
window_size: maximize
capabilities:
'os': 'Windows'
'os_version': '10'
'browser_version': '57'
'acceptSslCerts': true
'resolution': '1600x1200'
'browserstack.chrome.enablePopups': true
'browserstack.chrome.allowAllCookies': true
My question here is how would I insert the REST module without using phpbrowser? It appears that it may be required, but does anybody know otherwise?
It is impossible - WebDriver and REST modules are incompatible.
PROBLEM:
Yesterday Codeception introduced new extension which should help with starting/stopping Selenium Server, Chrome Driver, etc (more here). However, even it shows that processes are starting - they're actually not.
acceptance.suite.yml
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: http://127.0.0.1:8080/
browser: chrome
- Yii2:
part: orm
entryScript: index-test.php
cleanup: false
extensions:
enabled:
- Codeception\Extension\RunProcess:
- java -jar /home/tajgeer/.executables/bin/selenium-server.jar
- php /home/tajgeer/Repozytoria/Yii2/yii serve
output:
Acceptance Tests (5)
[RunProcess] Starting java -jar /home/tajgeer/.executables/bin/selenium-server.jar
[RunProcess] Starting php /home/tajgeer/Repozytoria/Yii2/yii serve
E AboutCest: Ensure that about works
E ContactCest: Ensure that contact page works
E ContactCest: Contact form can be submitted
E HomeCest: Ensure that home page works
E LoginCest: Ensure that login works
[RunProcess] Stopping php /home/tajgeer/Repozytoria/Yii2/yii serve
[RunProcess] Stopping java -jar /home/tajgeer/.executables/bin/selenium-server.jar
example error:
[ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running.
I've already tried to set o+x permissions on both execs - didn't change anything. When I'm trying to run both tools by using entered commands - everything works well.
Could anyone point out what am I doing wrong?
SOLUTION:
Actually... I've solved it on my own. I've forgot about sleep (processes didn't even had a chance to run as tests were very quick). I've changed acceptance.suite.xml to following:
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: http://127.0.0.1:8080/
browser: chrome
- Yii2:
part: orm
entryScript: index-test.php
cleanup: false
extensions:
enabled:
- Codeception\Extension\RunProcess:
0: java -jar /home/tajgeer/.executables/bin/selenium-server.jar
1: php /home/tajgeer/Repozytoria/Yii2/yii serve
sleep: 5
I am Writing scripts for Browserstack using PHP Codeception.
Here it is my acceptance.yml file
modules:
enabled:
- WebDriver
config:
WebDriver:
url: 'http://www.google.com'
host: 'hub.browserstack.com'
port: 80
browser: Android
device: Samsung Galaxy S5
deviceOrientation: portrait
capabilities:
'browserstack.user': 'USERNAME'
'browserstack.key' : 'ACCESS_KEY'
'browserVersion': '21.0'
'browserstack.debug': 'true'
But after run the program through the command line, it will be displaying as below error message in command prompt.
**[Facebook\WebDriver\Exception\UnknownServerException]
Session terminated**
I will change some script like url: 'http://localhost:8080' and 'browserstack.local': 'false' From the above acceptance.yml file.
Then Error being displayed as "Unable to Connect to Server"
Can anyone please give some suggestion to resolve this problem.
You need to set the capabilities as follows when executing a test on Android emulators (Samsung Galaxy S5) on BrowserStack:
config:
WebDriver:
url: 'http://www.google.com'
host: 'hub.browserstack.com'
port: 80
browser: android
capabilities:
'browserstack.user': '<username>'
'browserstack.key' : '<automate-key>'
'device': 'Samsung Galaxy S5'
'platform': 'ANDROID'
Note: 'android' for browser needs to be all lower case and for platform all upper case.
The Code Generator can be very helpful to specify the capabilities while testing on different browser and OS combinations especially mobile devices.
If you wish to access your local servers on BrowserStack, such as 'http://localhost:8080', you can follow these steps:
a) Setup a Local Testing connection using the binaries.
b) Add the capability 'browserstack.local': 'true' in your scripts.
I use Codeception with webdriver and use command line to start tests. I try to use webception to show it on a web-application for my colleagues so I deployed webception on my FTP but i have problems with piloting selenium. I didnt succeed to run the test from my ftp with webcept.
[WebDriverCurlException]
Curl error thrown for http POST to http://127.0.0.1:4444/wd/hub/session with params: {"desiredCapabilities":{"unexpectedAlertBehaviour":"accept","browserName":"firefox"}}
couldn't connect to host
Here is my acceptance.suit.yml :
class_name: WebGuy
modules:
enabled:
#- PhpBrowser
- WebHelper
- REST
- WebDriver
config:
REST:
url: 'http://theAddress/'
timeout: 90
PhpBrowser:
url: 'http://theAddress/'
curl:
CURLOPT_RETURNTRANSFER: true
CURLOPT_FOLLOWLOCATION: true
WebDriver:
url: 'http://theAddress/'
browser: firefox
capabilities:
unexpectedAlertBehaviour: 'accept'
Any suggestions will be welcome. thank you
Try to run Selenium manually. Download Selenium Server here Selenium Downloads , then in the command line, navigate to the folder where the file has been downloaded and type:
java -jar selenium-server-standalone-W.XY.Z.jar
Now, Selenium should be running on the 4444 port. After that, try to run your test again.