1

나는 각도기를 사용하여 새로운 테스트를 할 수 있지만 테스트를 실행할 수 없습니다. 내 protractor.config.js :jasmine protractor로 e2e testin "no specs found"

exports.config = { 

    allScriptsTimeout: 99999, 

    // The address of a running selenium server. 
    seleniumAddress: 'http://localhost:4444/wd/hub', 

    // Capabilities to be passed to the webdriver instance. 
    capabilities: { 
    browserName: 'chrome' 
    }, 

    baseUrl: 'http://localhost:8080/', 

    framework: 'jasmine', 

    // Spec patterns are relative to the current working directly when 
    // protractor is called. 
    specs: ['.src/test/e2e/login.e2e.spec.js'], 

    // Options to be passed to Jasmine-node. 
    jasmineNodeOpts: { 
    showColors: true, 
    defaultTimeoutInterval: 30000, 
    isVerbose: true, 
    includeStackTrace: true 
    } 
}; 

이 내가 실행하는 데 노력하고있어 테스트입니다 :

'use strict'; 

    describe('my app', function() { 

     beforeEach(function() { 
     browser.get('index.html'); 
     }); 

     it('should automatically redirect to/when location hash is empty', function() { 
     expect(browser.getLocationAbsUrl()).toMatch("/"); 
     }); 
    }); 

을 그리고 이것은 내가 오류입니다 :

I/hosted - Using the selenium server at http://localhost:4444/wd/hub 
[13:20:49] I/launcher - Running 1 instances of WebDriver 
Started 


No specs found 
Finished in 0.001 seconds 

[13:20:50] I/launcher - 0 instance(s) of WebDriver still running 
[13:20:50] I/launcher - chrome #01 passed 
[13:20:50] The following tasks did not complete: e2e 
[13:20:50] Did you forget to signal async completion? 

I을 webdriver-manager와 내 app 서버를 실행 중입니다. 내 재 스민 버전은 2.5.2 이고 각도기 버전은 4.09

내가 뭘 잘못하고 있는지 알 수 있습니까?

감사합니다 !!!

+0

아마도 사양에 지정한 파일 경로가 잘못되었음을 의미합니다. 테스트를 실행하기 위해 어떤 명령을 사용하고 있습니까? – Gunderson

+0

테스트 폴더 트리가 어떻게 생겼습니까? – stsatlantis

+0

안녕하세요! gulp 작업을 사용하고 있습니다 : function e2e() { gulp.src ([ "./src/tests/* .js"]) pipe (분도기 ({ configFile : "conf/protractor.config.던져; }); } –

답변

0

내 문제가 무엇인지 깨달았습니다 (실현에 도움이 된 의견 덕분에). 나는이 이유를 잘 모릅니다

function e2e() { 
    gulp.src(["/src/test/*.js"]).pipe(protractor({ 
    configFile: "conf/protractor.config.js", 
    args: ['--baseUrl', 'http://localhost8080'] 
    })).on('error', function (e) { 
    throw e; 
    }); 
} 

: 나는 꿀꺽 작업 내 테스트를 실행했다 내가 만든 gulp.src(["/src/test/*.js"]) 그런게 내 테스트 파일에 대한 액세스를 받고, 그래서 나는 그것을 변경 : 알아 gulp.src(["src/test/e2e/login.e2e.spec.js"])

의 최상의 솔루션은 아니지만 생존하기에 충분합니다.

+1

당신이 가진 문제는'src/test/login.e2e.spec.js'가' src/test/e2e/login.e2e.spec.js' 대신에'src/test/**/*. js'를 사용해보십시오. – tehbeardedone

+0

당신 말이 맞습니다. 감사!! –