Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/camilotk/selenium-teste
Um pequeno experimento de usar selenium, laravel e lambdatest.
https://github.com/camilotk/selenium-teste
Last synced: 4 days ago
JSON representation
Um pequeno experimento de usar selenium, laravel e lambdatest.
- Host: GitHub
- URL: https://github.com/camilotk/selenium-teste
- Owner: Camilotk
- License: mit
- Created: 2020-03-20T17:13:56.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T16:39:35.000Z (almost 2 years ago)
- Last Synced: 2024-10-28T21:15:37.343Z (about 2 months ago)
- Language: PHP
- Homepage:
- Size: 322 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Selenium
This is a test repository for learning and test Laravel Dusk with Selenium.# Step-by-Step
1. Install composer library on Laravel project:```composer
composer require --dev laravel/dusk
```2. Do the Laravel Dusk install command.
```
php artisan dusk:install
```3. Add on .env file the username and API Key of LambdaTest, both can be found in your [acoount profile](https://accounts.lambdatest.com/detail/profile).
**.env**
```
LT_USERNAME="your username"
LT_ACCESS_KEY="your access key"
```
4. in the folder tests/DuskTestCase.php comment the content of prepare() method and add in driver method before return:
```php
$options = (new ChromeOptions)->addArguments([
'--headless',
'--disable-gpu',
'--no-sandbox',
'--ignore-certificate-errors',
]);$username = env('LT_USERNAME');
$access_key = env('LT_ACCESS_KEY');
$url = "https://".$username.":".$access_key."@hub.lambdatest.com/wd/hub";return RemoteWebDriver::create($url, {DesiredCapabilities});
```
5. Replace {DesiredCapabilities} by the contents generated by [this link](https://www.lambdatest.com/capabilities-generator/). Important that 'tunnel' is set as true to everything work.
6. Download the lambdatest zip achive and extract the LT binary.
7. Then in terminal in same folder that are the LT binary copy and paste the command in "configure tunel" of lambdatest dashboard (remember to select 'home' checkbox) and replace '/home/selenium' for the path to public folder of project.
8. Generate the test:``` php artisan dusk:make {class}Test ```
9. Write the tests.
10. Test:
```php artisan dusk ```