{"id":212,"date":"2023-09-30T12:42:53","date_gmt":"2023-09-30T12:42:53","guid":{"rendered":"https:\/\/yascribe.com\/?page_id=212"},"modified":"2023-10-27T15:45:24","modified_gmt":"2023-10-27T15:45:24","slug":"java-client","status":"publish","type":"page","link":"https:\/\/yascribe.com\/index.php\/java-client\/","title":{"rendered":"yascribe client &#038; Java project"},"content":{"rendered":"\n<p>yascribe client can be executed to run test plans in a Java environment such as IntelliJ or Maven.<\/p>\n\n\n\n<p>Java 17 or higher is required.<\/p>\n\n\n\n<p><strong><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">To try yascribe out, use the evaluation server :<\/mark><\/em><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">eval.yascribe.com<\/mark><\/em><\/strong><\/li>\n\n\n\n<li><strong><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">9090<\/mark><\/em><\/strong><\/li>\n<\/ul>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\"><em>Only Chrome and Firefox are available on the evaluation server.<\/em><\/mark><\/p>\n\n\n\n<p>A demo project is available on <a href=\"https:\/\/github.com\/yascribe\/yascribe-jcl-demo\">Github<\/a>.<\/p>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><strong>Setup<\/strong><\/p>\n\n\n\n<p> In Maven, add the following dependency in your pom.xml :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;dependency><\/mark>\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;groupId><\/mark>com.yascribe<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/groupId><\/mark>\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;artifactId><\/mark>yascribe-java-client<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/artifactId><\/mark>\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;version><\/mark>1.0.1<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/version><\/mark>\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;scope><\/mark>test<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/scope><\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/dependency><\/mark><\/code><\/pre>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><strong>Configuring the test environment<\/strong><\/p>\n\n\n\n<p>Create the <code>yascribe.config.properties<\/code> file at the root of the project folder :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\"><em>## Scribe server configuration\n# the server name<\/em><\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.yascribe.server.name<\/mark>=localhost\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\"><em># the server port<\/em><\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">ya<\/mark>scribe.server.port<\/mark>=9090\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\"><em>## Project configuration\n# Project directory<\/em><\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">ya<\/mark>scribe.project.dir<\/mark>=.\/\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\"><em># Scribe directory<\/em><\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">ya<\/mark>scribe.project.scribeDir<\/mark>=yascribe\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\"><em># Report directory<\/em><\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">ya<\/mark>scribe.project.reportDir<\/mark>=yascribe\/reports\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\"><em>## Test configuration\n# Browser name: Chrome, Firefox, Edge, for example<\/em><\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">ya<\/mark>scribe.browser.name<\/mark>=Chrome\n# Browser width\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.yascribe.browser.width<\/mark>=1280\n# Browser height\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.yascribe.browser.height<\/mark>=1080\n# Browser language : if empty or not specified then the default language is used\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.yascribe.browser.language<\/mark>=en\n# Taking a screenshot on test failure : true or false\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.yascribe.screenshotOnFailure<\/mark>=false<\/code><\/pre>\n<\/div>\n\n\n\n<p>Replace <code>localhost <\/code>and <code>9090 <\/code>by your yascribe server name and port. <\/p>\n\n\n\n<p><strong><em>To try yascribe out, use the evaluation server :<\/em><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><em>eval.yascribe.com<\/em><\/strong><\/li>\n\n\n\n<li><strong><em>9090<\/em><\/strong><\/li>\n<\/ul>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">ya<\/mark>scribe.project.scribeDir<\/mark> is the folder where test plans (<code>.feature<\/code> files) are stored. The default subfolder <em>yascribe <\/em>can be replaced by another folder.<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">ya<\/mark>scribe.project.reportDir<\/mark> is the folder where test reports will be generated in two formats : <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>json<\/li>\n\n\n\n<li>markdown<\/li>\n<\/ul>\n\n\n\n<p>The default subfolder <em>yascribe\/reports <\/em>can be replaced by another folder.<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">ya<\/mark>scribe.browser.name<\/mark> : 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.<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.yascribe.browser.width<\/mark>, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.yascribe.browser.height <\/mark>, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.yascribe.browser.language<\/mark> and <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.yascribe.screenshotOnFailure<\/mark> are optional. If they are not specified then default values will be used. <\/p>\n\n\n\n<p><em>When <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">com.yascribe.screenshotOnFailure<\/mark> is set to <code>true<\/code>, the report files may be large.<\/em><\/p>\n<\/div>\n<\/div>\n\n\n\n<p><strong>Starter class<\/strong><\/p>\n\n\n\n<p>A starter class is required to launch test plan with IDE launchers (such as IntelliJ launcher).<\/p>\n\n\n\n<p>Create a test class (in <code>src\/test\/java\/<\/code>) and annotate it with <code>@ScribeTest<\/code>, for example :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@ScribeTest\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">public class<\/mark> ScribeStarter {\n}<\/code><\/pre>\n\n\n\n<p>To launch specific test plans and not all test plans, specify the test plan files via the annotation :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@ScribeTest(\n  files = { <em>\"test-plan-2.feature\"<\/em>, <em>\"test-plan-4.feature\"<\/em> }\n)\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">public class<\/mark> ScribeStarter {\n}<\/code><\/pre>\n\n\n\n<p>Finally, start the tests via the IDE launcher.<\/p>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><strong>Running tests via Maven &amp; <a href=\"https:\/\/maven.apache.org\/surefire\/maven-surefire-plugin\/\">Surefire<\/a><\/strong><\/p>\n\n\n\n<p>Include the starter class in the <strong><a href=\"https:\/\/maven.apache.org\/surefire\/maven-surefire-plugin\/\">Surefire<\/a><\/strong> configuration, for example :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;plugin><\/mark>\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;groupId><\/mark>org.apache.maven.plugins<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/groupId><\/mark>\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;artifactId><\/mark>maven-surefire-plugin<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/artifactId><\/mark>\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;version><\/mark>3.1.2<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/version><\/mark>\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;configuration><\/mark>\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;includes><\/mark>\n      <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;include><\/mark>ScribeStarter.java<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/include><\/mark>\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/includes><\/mark>\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/configuration><\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/plugin><\/mark> <\/code><\/pre>\n\n\n\n<p>Then execute <code>'mvn clean install'<\/code>.<\/p>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><strong>Running tests via Maven &amp; <a href=\"https:\/\/maven.apache.org\/surefire\/maven-failsafe-plugin\/\">Failsafe<\/a><\/strong><\/p>\n\n\n\n<p>Include the starter class in the <strong><a href=\"https:\/\/maven.apache.org\/surefire\/maven-failsafe-plugin\/\">Failsafe<\/a><\/strong> configuration, for example :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;plugin><\/mark>\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;groupId><\/mark>org.apache.maven.plugins<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/groupId><\/mark>\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;artifactId><\/mark>maven-failsafe-plugin<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/artifactId><\/mark>\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;version><\/mark>3.1.2<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/version><\/mark>\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;executions><\/mark>\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;execution><\/mark>\n      <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;goals><\/mark>\n        <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;goal><\/mark>integration-test<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/goal><\/mark>\n        <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;goal><\/mark>verify<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/goal><\/mark>\n      <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/goals><\/mark>\n      <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;configuration><\/mark>\n        <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;includes><\/mark>\n          <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;include><\/mark>ScribeStarter.java<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/include><\/mark>\n        <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/includes><\/mark>\n      <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/configuration><\/mark>\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/execution><\/mark>\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/executions><\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">&lt;\/plugin><\/mark> <\/code><\/pre>\n\n\n\n<p>Then execute <code>'mvn clean install'<\/code>.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 : Only Chrome and Firefox are available on the evaluation server. A demo project is available on Github. Setup In Maven, add the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-212","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/pages\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":35,"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/pages\/212\/revisions"}],"predecessor-version":[{"id":316,"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/pages\/212\/revisions\/316"}],"wp:attachment":[{"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/media?parent=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}