yascribe client & Java project


yascribe client can be executed to run test plans in a Java environment such as IntelliJ or Maven.

Java 17 or higher is required.

To try yascribe out, use the evaluation server :

  • eval.yascribe.com
  • 9090

Only Chrome and Firefox are available on the evaluation server.

A demo project is available on Github.

Setup

In Maven, add the following dependency in your pom.xml :

<dependency>
    <groupId>com.yascribe</groupId>
    <artifactId>yascribe-java-client</artifactId>
    <version>1.0.1</version>
    <scope>test</scope>
</dependency>

Configuring the test environment

Create the yascribe.config.properties file at the root of the project folder :

## Scribe server configuration
# the server name
com.yascribe.server.name=localhost
# the server port
com.yascribe.server.port=9090

## Project configuration
# Project directory
com.yascribe.project.dir=./
# Scribe directory
com.yascribe.project.scribeDir=yascribe
# Report directory
com.yascribe.project.reportDir=yascribe/reports

## Test configuration
# Browser name: Chrome, Firefox, Edge, for example
com.yascribe.browser.name=Chrome
# Browser width
com.yascribe.browser.width=1280
# Browser height
com.yascribe.browser.height=1080
# Browser language : if empty or not specified then the default language is used
com.yascribe.browser.language=en
# Taking a screenshot on test failure : true or false
com.yascribe.screenshotOnFailure=false

Replace localhost and 9090 by your yascribe server name and port.

To try yascribe out, use the evaluation server :

  • eval.yascribe.com
  • 9090

com.yascribe.project.scribeDir is the folder where test plans (.feature files) are stored. The default subfolder yascribe can be replaced by another folder.

com.yascribe.project.reportDir is the folder where test reports will be generated in two formats :

  • json
  • markdown

The default subfolder yascribe/reports can be replaced by another folder.

com.yascribe.browser.name : specify one or several browsers to run tests. In the case of multi-browsers, use a `,` as separator character. If using the evaluation server then only Chrome, Firefox and Edge are available.

com.yascribe.browser.width, com.yascribe.browser.height , com.yascribe.browser.language and com.yascribe.screenshotOnFailure are optional. If they are not specified then default values will be used.

When com.yascribe.screenshotOnFailure is set to true, the report files may be large.

Starter class

A starter class is required to launch test plan with IDE launchers (such as IntelliJ launcher).

Create a test class (in src/test/java/) and annotate it with @ScribeTest, for example :

@ScribeTest
public class ScribeStarter {
}

To launch specific test plans and not all test plans, specify the test plan files via the annotation :

@ScribeTest(
  files = { "test-plan-2.feature", "test-plan-4.feature" }
)
public class ScribeStarter {
}

Finally, start the tests via the IDE launcher.

Running tests via Maven & Surefire

Include the starter class in the Surefire configuration, for example :

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>3.1.2</version>
  <configuration>
    <includes>
      <include>ScribeStarter.java</include>
    </includes>
  </configuration>
</plugin> 

Then execute 'mvn clean install'.

Running tests via Maven & Failsafe

Include the starter class in the Failsafe configuration, for example :

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-failsafe-plugin</artifactId>
  <version>3.1.2</version>
  <executions>
    <execution>
      <goals>
        <goal>integration-test</goal>
        <goal>verify</goal>
      </goals>
      <configuration>
        <includes>
          <include>ScribeStarter.java</include>
        </includes>
      </configuration>
    </execution>
  </executions>
</plugin> 

Then execute 'mvn clean install'.