github.com/jaylevin/jenkins-library@v1.230.4/documentation/docs/steps/seleniumExecuteTests.md (about)

     1  # ${docGenStepName}
     2  
     3  ## ${docGenDescription}
     4  
     5  ## Prerequisites
     6  
     7  none
     8  
     9  ## Example
    10  
    11  ```groovy
    12  seleniumExecuteTests (script: this) {
    13      git url: 'https://github.com/xxxxx/WebDriverIOTest.git'
    14      sh '''npm install
    15          node index.js'''
    16  }
    17  ```
    18  
    19  ### Example test using WebdriverIO
    20  
    21  Example based on <http://webdriver.io/guide/getstarted/modes.html> and <http://webdriver.io/guide.html>
    22  
    23  #### Configuration for Local Docker Environment
    24  
    25  ```js
    26  var webdriverio = require('webdriverio');
    27  var options = {
    28      host: 'selenium',
    29      port: 4444,
    30      desiredCapabilities: {
    31          browserName: 'chrome'
    32      }
    33  };
    34  ```
    35  
    36  #### Configuration for Kubernetes Environment
    37  
    38  ```js
    39  var webdriverio = require('webdriverio');
    40  var options = {
    41      host: 'localhost',
    42      port: 4444,
    43      desiredCapabilities: {
    44          browserName: 'chrome'
    45      }
    46  };
    47  ```
    48  
    49  #### Test Code (index.js)
    50  
    51  ```js
    52  // ToDo: add configuration from above
    53  
    54  webdriverio
    55      .remote(options)
    56      .init()
    57      .url('http://www.google.com')
    58      .getTitle().then(function(title) {
    59          console.log('Title was: ' + title);
    60      })
    61      .end()
    62      .catch(function(err) {
    63          console.log(err);
    64      });
    65  ```
    66  
    67  ## ${docGenParameters}
    68  
    69  ## ${docGenConfiguration}
    70  
    71  ## ${docJenkinsPluginDependencies}
    72  
    73  ## Side effects
    74  
    75  none
    76  
    77  ## Exceptions
    78  
    79  none