> For the complete documentation index, see [llms.txt](https://docs.precisiontestautomation.in/scriptlessautomation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.precisiontestautomation.in/scriptlessautomation/automation-import-notes/points-to-remember.md).

# Points to Remember

<details>

<summary>IDE Run Configuration</summary>

To run automation through intellij/IDE one should need to create a configuration in intellij

<img src="https://1894392350-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiGaaGnfeM1ej74weWKLs%2Fuploads%2FOayhPwv9lrrgYblNPVXn%2Fimage.png?alt=media&amp;token=ca1cce26-2a07-46eb-ab82-274e8d860972" alt="" data-size="original">

* **Main Class**:&#x20;

  ```
  in.precisiontestautomation.runner.ScriptlessApplication
  ```

  * The entry point of the automation process.
* **CLI Arguments**: `true`
  * `true` specifies execution through Maven and `false`  specifies not executing through maven.

While setting up configuration on IDE keep **CLI Arguments** as`false` . This configuration tell the framework that it got triggered by IDE.

#### Difference between *true* and *false*

* **true**: it indicates that the automation was initiated by Maven. In this scenario, the automation process first generates a TestNG file in the target folder, which then needs to be manually triggered to run the tests
* **false**: it signifies that the automation was started from an Integrated Development Environment (IDE). Here, the automation process directly executes the test cases and subsequently creates a TestNG file in the target folder upon completion of the test execution.

</details>

<details>

<summary>Maven Run Configuration</summary>

The below configuration should be added to the pom of the project:

```xml
<build>
        <sourceDirectory>/src/main</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <compilerArgument>-parameters</compilerArgument>
                    <parameters>true</parameters>
                    <testCompilerArgument>-parameters</testCompilerArgument>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>in.precisiontestautomation.runner.ScriptlessApplication</mainClass>
                    <arguments>
                       <argument>true</argument>
                    </arguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M4</version>
                <configuration>
                    <argLine>-XX:+ExplicitGInvokesConcurrent</argLine>
                    <argLine>--add-opens java.base/java.lang.reflect=ALL-UNNAMED</argLine>
                    <testFailureIgnore>false</testFailureIgnore>
                    <suiteXmlFiles>
                        <suiteXmlFile>target/testngenerator.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>
        </plugins>
    </build>
```

#### Maven Commands

maven command to execute automation through terminal using maven command

`mvn clean exec:java test`

#### Maven Goals explanation

* **mvn** -> This is the command line invocation of Maven
* **clean** -> This is a Maven phase that belongs to the 'clean' lifecycle. When you run `mvn clean`, it removes the files in the project's `target` directory (the default build directory in Maven)
* **exec:java** -> This is a goal from the `exec-maven-plugin`. The `exec:java` goal is used to execute a Java class in the current project with the specified main class and arguments
* **test** -> The mvn test command is part of Maven's 'test' lifecycle phase. Executing this command activates TestNG tests specified under the maven-surefire-plugin in the project's pom.xml file.

</details>

<details>

<summary>TestCase Name Syntax</summary>

Our test automation framework employs a structured naming convention for test cases to ensure clarity and easy traceability. Each test case file is named following the format: "TestCaseId\_GroupName.csv".

**Components of the Naming Convention**

1. **TestCaseId**:
   * **Description**: This is the unique identifier for the test case, as recorded in our test management tool.
   * **Purpose**: Helps in tracing the automated test back to its corresponding test case in the test management system for reference and reporting.
2. **GroupName**:
   * **Description**: Indicates the test group or category to which the test case belongs. Common groups include 'sanity', 'smoke', and 'regression'.
   * **Purpose**: Facilitates organizing and selecting test cases based on testing phases or objectives.

**File Format**

* **.csv**: The test cases are saved in **CSV** (Comma-Separated Values) format, which allows for easy editing and readability.
* **.feature:** The test cases are saved in **Gherkin syntax**, which allows for easy editing and readability. This format defines test cases in a natural language style (e.g., "Given-When-Then"), making it accessible to both technical and non-technical stakeholders.

**Examples**

* **101\_sanity.csv**: A test case with ID 101, designated for the sanity test suite.
* **204\_regression.csv**: A test case with ID 204, meant for regression testing.
* **301\_sanity.feature:** A test case with ID 301, written in Gherkin syntax, designated for the sanity test suite.

</details>
