Can I pass capabilities in Selenium 4 for PHP Codeception?
Hi Tom,
Please refer to the sample test case below:
php
class FirstCest
{
public function frontpageWorks(AcceptanceTester $I)
{
sleep(5);
$I->amOnPage('/sample-todo-app');
sleep(2);
$I->checkOption('/html/body/div/div/div/ul/li[4]/input');
sleep(2);
$I->checkOption('/html/body/div/div/div/ul/li[5]/input');
}
}
In the test script, you need to update your test capabilities. Notice the declaration of class name “AcceptanceTester”. We used this class to specify test capabilities:
# Codeception Test Suite Configuration - For running single test
#
# Suite for acceptance tests.
# Perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
config:
WebDriver:
host: 'LT_USERNAME:LT_ACCESS_KEY@hub.lambdatest.com'
port: 80
url: 'https://lambdatest.github.io/'
browser: chrome
capabilities:
"browserName": "Chrome",
"browserVersion": "104.0",
"LT:Options": {
"platformName": "Windows 10",
"project": "Untitled",
"selenium_version": "4.0.0",
"w3c": true,
"plugin": "php-codeception"
}