### Enabling a Plugin Example Source: https://tm-fr.doc.squashtest.com/v14/install-guide/installation/installation-squash/installation-docker.html To activate a plugin, uncomment its line in the start-plugins.cfg file. The example shows how to change a commented-out plugin to an active one. ```properties |# apt-rest ---> |api-rest ``` -------------------------------- ### Install squash-tf-services Library Source: https://tm-fr.doc.squashtest.com/v14/user-guide/gestion-tests-automatises/techno/robotframework.html Install the necessary Python library for integrating Robot Framework with SquashTM services. ```bash pip install squash-tf-services ``` -------------------------------- ### Start Squash TM Application Source: https://tm-fr.doc.squashtest.com/v14/install-guide/installation/installation-squash/installation-applicatif.html Navigate to the bin directory and start Squash TM in the background using nohup. Ensure you are in the /opt/squash-tm/bin directory before executing. ```bash cd /opt/squash-tm/bin nohup ./startup.sh & ``` -------------------------------- ### Installer Playwright globalement Source: https://tm-fr.doc.squashtest.com/v14/user-guide/gestion-tests-automatises/techno/playwright.html Utilisez cette commande pour installer Playwright globalement sur votre système. Une installation globale est nécessaire pour que Squash TM puisse exécuter les tests. ```bash npm install -g playwright ``` -------------------------------- ### Install Newman and HTML Reporter Source: https://tm-fr.doc.squashtest.com/v14/user-guide/gestion-tests-automatises/techno/postman.html Install Newman and its HTML reporter globally using npm. Ensure Node.js is installed if npm is not available. ```bash npm install -g newman ``` ```bash npm install -g newman-reporter-html ``` -------------------------------- ### UFT Inception Workflow Example Source: https://tm-fr.doc.squashtest.com/v14/user-guide/gestion-tests-automatises/devops/actions/uft.html Example of a workflow using inception to pre-load UFT test execution reports and then execute UFT tests. ```yaml metadata: name: UFT Inception resources: files: - report1 jobs: my_specific_job: runs-on: inception steps: - uses: actions/prepare-inception@v1 with: uft-results.xml: ${{ resources.files.report1 }} - uses: uft/execute@v1 with: test: uftSolution/uftTestFolder ``` -------------------------------- ### Robot Framework Test Setup Keyword Source: https://tm-fr.doc.squashtest.com/v14/howto/bdd%2Brobotframework/automateTestCases.html Implements the 'Open Application' keyword for test setup. It opens a new browser instance, navigates to the specified URL, and configures viewport size. Includes failure handling for screenshots. ```robotframework ***Keywords*** Open Application [Documentation] Test setup. Register Keyword To Run On Failure Take Screenshot failure_screen_{index} fullPage=True New Browser browser=firefox headless=True New Page url=${URL} Set Viewport Size 1900 1000 ``` -------------------------------- ### Remove Prestashop Install Directory Source: https://tm-fr.doc.squashtest.com/v14/howto/annexes/prestashopInstallation.html Removes the 'install' directory from the Prestashop container after initial setup to prevent re-installation prompts. ```bash docker exec -it some-prestashop rm -fr install ``` -------------------------------- ### GET Request to List Jira Plugins Source: https://tm-fr.doc.squashtest.com/v14/install-guide/installation/installation-plugins/installer-plugins.html Use this GET request with Basic Authentication to retrieve a list of installed plugins in Jira. The `upm-token` from the response header is required for subsequent POST requests. ```http https://Url-de-Jira.atlassian.net/rest/plugins/1.0/?os_authType=basic ``` ```http Accept: application/vnd.atl.plugins.installed+json ``` -------------------------------- ### POST Request to Install Xsquash Cloud via API Source: https://tm-fr.doc.squashtest.com/v14/install-guide/installation/installation-plugins/installer-plugins.html This POST request installs Xsquash Cloud using its descriptor URL. Ensure you replace `Upm-Token` with the token obtained from the previous GET request's `upm-token` header. Basic Authentication with administrator credentials and API token is required. ```http https://Url-de-Jira.atlassian.net/rest/plugins/1.0/?token=Upm-Token ``` ```http Content-type: application/vnd.atl.plugins.uri+json ``` ```http Accept: application/json ``` ```json { "pluginUri": "https://Url-Xsquash-Cloud.com/atlassian-connect.json", "pluginName": "Xsquash Cloud" } ``` -------------------------------- ### Execute Test Suite (All Inputs) Source: https://tm-fr.doc.squashtest.com/v14/user-guide/gestion-tests-automatises/devops/actions/katalon.html This example shows how to execute a single test suite with all available optional parameters, including browser type, execution profile, retry settings, reporting configurations, and status delay. ```yaml - uses: katalon/katalon@v1 with: # Project location (include `.prj` file), from the root folder of the workspace project: path/to/project.prj # Test suite file (without extension `.ts`) test-suite-path: path/to/test_suite_file # Web Service|Firefox|Chrome|Remote|IE|Edge|Edge (Chromium)|Safari|Android|iOS browser-type: iOS # Execution profile that a test suite or a test suite collection executes with execution-profile: acceptance # number of retry times; 0 for no retry retry: 0 # (number in seconds) status-delay: 12 # e-mail address for receiving report files send-mail: me@example.com # Destination folder for saving report files report-folder: path/to/report_folder # Name for report files (`.html`, `.csv`, `.log`) report-file-name: summary # (all other options) extra-options: additional_options ``` -------------------------------- ### Quality Gate Command Output Source: https://tm-fr.doc.squashtest.com/v14/user-guide/gestion-tests-automatises/devops/qualitygate.html Example output of the `opentf-ctl get qualitygate` command when using a custom quality gate, showing rule results, thresholds, and scope. ```text RULE,RESULT,TESTS_IN_SCOPE,TESTS_FAILED,TESTS_PASSED,SUCCESS_RATIO,THRESHOLD,SCOPE Selenium tests,SUCCESS,20,2,18,90.0%,90%,(test.data.TC_CUF_TAG=='Selenium') && ((test.importance=='VERY_HIGH') || (test.importance=='HIGH')) RobotFramework,SUCCESS,40,5,35,87.5%,75%,(test.technology=='robotframework') && (test.data.DSNAME!='API tests') Workflow {workflow_id} passed the quality gate using mode custom.quality.gate. ``` -------------------------------- ### Basic Retry Hook Configuration Source: https://tm-fr.doc.squashtest.com/v14/user-guide/gestion-tests-automatises/devops/actions/retry.html This example demonstrates a basic setup for the retry hook. It re-runs failed Postman tests twice at the end of each job. The retry is triggered only if tests have a 'FAIL' status. ```yaml hooks: - name: Retry Hook events: - channel: teardown before: - uses: tm.squashtest.org/retry@v1 with: max-retry: 2 scope: test.technology == 'postman' failure-status: ['FAIL'] ``` -------------------------------- ### Installation du service Squash TM sous Windows Source: https://tm-fr.doc.squashtest.com/v14/install-guide/installation/installation-squash/installation-applicatif.html Utilisez cette commande dans une invite de commandes administrateur pour installer Squash TM en tant que service Windows. Remplacez `` par le répertoire d'installation de Squash TM. ```bash \squash-tm\bin\squash-tm.exe install ``` -------------------------------- ### Test Setup Method Source: https://tm-fr.doc.squashtest.com/v14/howto/bdd%2Bcucumber/automateTestCases.html Initializes the browser type and the host URL for the application under test before each test scenario. Uses PageObjectBase for configuration. ```java @Before public void setup() { PageObjectBase.setBrowser(PageObjectBase.Browser.FIREFOX); PageObjectBase.setHost("http://localhost:8080/fr"); } ``` -------------------------------- ### Verify Agent Installation Source: https://tm-fr.doc.squashtest.com/v14/install-guide/installation/installation-orchestrator/install.html Check if the OpenTestFactory agent has been installed correctly by running its help command. ```bash opentf-agent --help ``` -------------------------------- ### Lancer le daemon Maven avant la création du workspace Source: https://tm-fr.doc.squashtest.com/v14/faq/technicalDetails.html Utilisez un hook de `setup` pour lancer Maven Daemon avant que le workspace ne soit créé. Cela permet au daemon d'être lancé dans le dossier de l'agent, facilitant le nettoyage ultérieur. ```yaml hooks: - name: Launch Maven Daemon events: - channel: setup before: - run: mvn --version ``` -------------------------------- ### Load Quality Gate Definition at Orchestrator Startup (Bash) Source: https://tm-fr.doc.squashtest.com/v14/user-guide/gestion-tests-automatises/devops/qualitygate.html Use this command to load a quality gate definition file when starting the orchestrator. Mount the definition file locally and set the `QUALITYGATE_DEFINITIONS` environment variable. ```bash docker run ... \ -v /path/to/qg_def/my_qualitygate.yaml:/app/qualitygate/my_qualitygate.yaml \ -e QUALITYGATE_DEFINITIONS=/app/qualitygate/my_qualitygate.yaml \ ... ``` -------------------------------- ### Start Squash TM systemd Service Source: https://tm-fr.doc.squashtest.com/v14/install-guide/installation/installation-squash/installation-applicatif.html Manually start the Squash TM service using systemctl. ```bash systemctl start squash-tm ``` -------------------------------- ### Create Docker Network and Deploy Containers Source: https://tm-fr.doc.squashtest.com/v14/howto/annexes/prestashopInstallation.html Sets up a Docker network and deploys MySQL and Prestashop containers. Ensure the MySQL version and Prestashop image tag are compatible. ```bash docker network create prestashop-net docker run -ti --name some-mysql --network prestashop-net -e MYSQL_ROOT_PASSWORD=admin -p 3307:3306 -d mysql:5.7 docker run -ti --name some-prestashop --network prestashop-net -e DB_SERVER=some-mysql -p 8080:80 -d prestashop/prestashop:1.7 ``` -------------------------------- ### Navigate to Account Creation Page Source: https://tm-fr.doc.squashtest.com/v14/howto/bdd%2Bcucumber/automateTestCases.html Implement a 'When' step to navigate to the Account Creation page. This step performs a specific action. ```java /** * Go to the Account Creation page */ @When("I am on the AccountCreation page") public void displayNewAccountPage() { final AccountCreationPageObject newAccountPage = new AccountCreationPageObject(); newAccountPage.goTo(); } ``` -------------------------------- ### Example SquashTM Orchestrator Response Source: https://tm-fr.doc.squashtest.com/v14/admin-guide/gestion-serveurs/gerer-serveur-autom.html This is an example of a successful response when querying SquashTM Orchestrator for known channels. ```json {"apiVersion":"v1","code":200,"details":{"items":[{"apiVersion":"opentestfactory.org/v1alpha1","kind":"Channel","metadata":{"channelhandler_id":"907f43e2-b5a0-4594-a1c7-31f6bf667b38","name":"dummy.example.com","namespaces":"default"},"spec":{"tags":["ssh","linux"]},"status":{"currentJobID":null,"lastCommunicationTimestamp":"2022-09-16T12:18:01.640489","phase":"IDLE"}}]},"kind":"Status","message":"Known channels","metadata":{},"reason":"OK","status":"Success"} ``` -------------------------------- ### Initialisation du dépôt Git local Source: https://tm-fr.doc.squashtest.com/v14/howto/bdd%2Bcucumber/setup.html Utilisez cette commande pour créer la structure de répertoires nécessaire et initialiser un dépôt Git local sur votre machine. ```bash mkdir prestashop cd prestashop mkdir -p src/test/resources/prestashoptest touch src/test/resources/prestashoptest/.gitkeep git init git add . git commit -m "project setup" ``` -------------------------------- ### Install Robocop Linter Source: https://tm-fr.doc.squashtest.com/v14/howto/bdd%2Brobotframework/automateTestCases.html Installs the Robocop static code analysis tool for Robot Framework using pip. ```bash pip install robotframework-robocop ``` -------------------------------- ### Start Squash Orchestrator with Docker Compose Source: https://tm-fr.doc.squashtest.com/v14/install-guide/installation/installation-orchestrator/install.html Command to start Squash Orchestrator in detached mode using Docker Compose. ```bash docker compose up -d ``` -------------------------------- ### Load Quality Gate Definition at Orchestrator Startup (Shell) Source: https://tm-fr.doc.squashtest.com/v14/user-guide/gestion-tests-automatises/devops/qualitygate.html Use this command to load a quality gate definition file when starting the orchestrator. Mount the definition file locally and set the `QUALITYGATE_DEFINITIONS` environment variable. ```shell docker run ... ` -v d:\path\to\qg_def\my_qualitygate.yaml:/app/qualitygate/my_qualitygate.yaml ` -e QUALITYGATE_DEFINITIONS=/app/qualitygate/my_qualitygate.yaml ` ... ```