WebDriver\SauceLabs\SauceRest::getJob PHP Method

getJob() public method

Get full information for job: /rest/v1/:userId/jobs/:jobId (GET)
public getJob ( string $jobId ) : array
$jobId string
return array
    public function getJob($jobId)
    {
        return $this->execute('GET', $this->userId . '/jobs/' . $jobId);
    }

Usage Example

 /**
  * Verify how the API calls were made.
  *
  * @param TestEvent $event Event.
  *
  * @return void
  */
 public function verifyRemoteAPICalls(TestEvent $event)
 {
     $test_case = $event->getTestCase();
     if (get_class($test_case) !== get_class($this) || $test_case->getName() !== $this->getName()) {
         return;
     }
     $browser = $this->getBrowser();
     if ($browser instanceof SauceLabsBrowserConfiguration) {
         $session = $event->getSession();
         if ($session === null) {
             $this->markTestSkipped('Unable to connect to SauceLabs. Please check Internet connection.');
         }
         $sauce_rest = new SauceRest($browser->getApiUsername(), $browser->getApiKey());
         $job_info = $sauce_rest->getJob($session->getDriver()->getWebDriverSessionId());
         $this->assertEquals(get_class($test_case) . '::' . $test_case->getName(), $job_info['name']);
         $passed_mapping = array('testSuccess' => true, 'testFailure' => false);
         $this->assertSame($passed_mapping[$test_case->getName()], $job_info['passed']);
     }
 }
All Usage Examples Of WebDriver\SauceLabs\SauceRest::getJob