2014-11-06 10 views
0

내 견인기 테스트를 SauceLabs에서 성공적으로 실행하고 있습니다. 예를 들어 모든 테스트가 브라우저 이름별로 그룹화되어있는 경우와 같이 서비스 테스트까지 내 이름을 보낼 수 있기를 원하지만.각도기 및 Saucelabs testname을 보내십시오

SauceLabs까지 테스트 이름을 전달할 수있는 방법이 있습니까?

답변

1

저는 이것을 Selenium for Python을 사용하여했습니다. 그러나 각도기를 사용하면 conf.js 파일을 편집하여 capabilities 옵션에 테스트 이름이 포함 된 name 필드를 포함하게됩니다. 나는 또한 당신이 사용하는 코드의 어떤 빌드 알 수 있도록 build 필드를 사용하는 것이 좋습니다 :

capabilities: { 
    name: 'whatever name', 
    build: 'whatever build', 
    // Anything else you need 
} 

namebuild 필드는 크로스 플랫폼입니다.

+0

나는 이름을 본과 필드를 구축하지만, 문제는 코드가 실행을 시작하기 전에 이러한 설정 얻을, 그래서 테스트를 통과 할 수 이름을. 나는''beforeEach'''에''this.description'''을 실행하여 각 테스트의 이름을 얻을 수 있습니다.하지만 config에 그것을 주입하는 데 어려움을 겪고 있습니다. – joshuahornby10

+0

'name'과'build'는 Selenium 인스턴스가 시작될 때에 만 설정할 수 있습니다. 테스트 스위트에서 몇 개의 인스턴스를 시작합니까? – Louis

0

테스트하는 동안 SauceLabs sessionId가있는 경우 JSON 패킷을 the REST API으로 보내는 것처럼 간단합니다.

curl https://saucelabs.com/rest/v1/users/USERNAME -u YOUR_USERNAME:ACCESS_KEY 

당신은 아마, 수동 SauceLabs 세션을 시작 그것에서 세션 ID를 받고, 다음 수동으로 같은 'Postma N'으로 browsser JSON REST 클라이언트의 API 요청을 전송하여이를 테스트 할 수 있습니다.

0

에만이 같은 것을 추가해야 할 수도 있습니다 :

var testName = 'Testing'; //Change Project's name here in order to be identified in BrowserStack 




// An example configuration file. 
exports.config = { 
    // The address of a running selenium server. 
    seleniumAddress: 'http://xxxxx:[email protected]:80/wd/hub', 
    //seleniumAddress: 'http://hub.browserstack.com/wd/hub', 
    //seleniumAddress: 'http://127.0.0.1:4723/wd/hub',//Local Appium 
    // Capabilities to be passed to the webdriver instance. 
    multiCapabilities: [ 
     { 
      name: testName, 
      platformName: 'iOS', 
      platformVersion: '7.1', 
      browserName: '', 
      app: 'safari', 
      deviceName: 'iPhone Simulator', 
      'appium-version': "1.4.0", 
      username: 'xxxxxx', 
      accessKey: 'xxxxx' 

     } 
     , 
     { 
      name: testName, 
      platformName: 'Android', 
      platformVersion: '4.4', 
      browserName: 'Browser', 
      deviceName: 'Android Emulator', 
      'appium-version': "1.4.0", 
      username: 'xxxxx', 
      accessKey: 'xxxxx' 
     } 


     ],