Skip to content

Crocoblock/crocoblock-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run Crocoblock Plugins Tests With PHP On LambdaTest

Before you start

Before you begin automation testing with Selenium, you would need to:

  • Make sure that you have the latest PHP installed on your system. You can download and install PHP using following commands in the terminal:

    • MacOS:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    brew install php

    or if you already have Homebrew package manager

    brew install php
  • Download composer in the project directory (Linux/MacOS, Windows).

    Note: To use the composer command directly, it either should have been downloaded in the project directory or should be accessible globally which can be done by the command below:

    mv composer.phar /usr/local/bin/composer

Installing Selenium Dependencies

Step 1: Clone this repository and go to crocoblock-automation folder:

git clone https://github.com/Crocoblock/crocoblock-automation
cd crocoblock-automation

Step 2: Install the composer dependencies in the current project directory using the command below:

composer install

Setting Up Your Authentication

Make sure you have your LambdaTest credentials with you to run test automation scripts on LambdaTest Selenium Grid. You can obtain these credentials from the LambdaTest Automation Dashboard or through LambdaTest Profile.

Step 3: Set LambdaTest username and access_key into config.json.

Create in folder crocoblock-automation file config.json with next content

{
  "username": "YOUR_USERNAME",
  "access_key": "YOUR_ACCESS_KEY"
}

Executing the Tests

Step 4: The tests can be executed in the terminal using the following command:

php dispatch-tests.php

Your test results would be displayed on the test console (or command-line interface if you are using terminal/cmd) and on LambdaTest automation dashboard.

image

For Windows Users

1. Run CMD as administrator

2. Paste this code to install choco

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

3. Restart CMD as administrator and run this command

choco install php

4. Restart CMD as administrator and run this command

choco install composer

5.* Restart CMD as administrator and run this command

choco install git

6. Clone the repository to your computer by creating the necessary folder for this in advance and going to it

git clone https://github.com/Crocoblock/crocoblock-automation.git

7. In the folder with the project, run the command

composer update

Note: Most likely we will receive a message that you need to install the extension for the zip archive, you can simply enable it in the php.ini file where php itself is installed. There will be a hint where to look at the file location

8. Enable zip extension, in the file php.ini itself you just need to remove the ";" before the name of the extension. Next, run the command again

composer update

9. In the project folder, create a config.json file with the following contents

{
  "username": "YOUR_USERNAME",
  "access_key": "YOUR_ACCESS_KEY"
}

Note: take your login and access key from your LambdaTest account

10. Run the test

php dispatch-tests.php

11. If the test does not run due to an error in the ssl certificate, then take the following steps. Download this file cacert.pem Save it in the project folder. In the php.ini file, write the path to the cacert.pem file here

12. Run the test

php dispatch-tests.php

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages