나는 angular2에 대한 각도기 셀레늄 테스트를 protractor conf.js --params.login.username=John --params.login.password=Doe
과 함께 실행합니다. 테스트는 백엔드에 로그인하려고 시도하고 액세스가 거부되면 실패합니다. Selenium Auth0이 서버에 연결할 수 없습니다.
이
은conf.js
입니다 :
exports.config = {
framework: 'jasmine2',
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
'browserName': 'chrome'
},
baseUrl:'http://127.0.0.1:4200',
specs: ['mytest.spec.js'],
useAllAngular2AppRoots: true,
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
}
webdriver는 webdriver-manager start
시작했다. 앱이 잘로드되고 아래 그림과 같이 테스트가 Auth0 팝업을 채 웁니다. 그런 다음 제출 단추를 클릭합니다. 그러나 이로 인해 로그인이 아닌 아래 오류 메시지가 표시됩니다. 올바르게 이해하면 Auth0은 인증 서버에 연결할 수 없습니다. 수동으로 로그인 할 때 문제는 아닙니다.
auth0 잠금 버전은 10.0입니다. 내가 stackoverflow.com 같은 다른 비 로컬 호스트 주소를 확인 할 수 browser.pause()
을 통해
액세스 할 수 있습니다.
어디에서 발생했는지, 어떻게 해결할 수 있는지 알고 싶습니다.
업데이트 : 다음과 같은 메시지가 표시됩니다 개발자 콘솔에서
.
XMLHttpRequest cannot load https://MYDOMAIN.eu.auth0.com/usernamepassword/login.
Response to preflight request doesn't pass access control check:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://127.0.0.1:4200' is therefore not allowed access.
잠금으로 인해 오류가 발생했는지 검사 할 수 있습니까? (잠금 버전도 이에 해당합니까?) – ShrekOverflow
이에 따라 질문이 업데이트되어 문제가 발견되었습니다. 고맙습니다! – michaelbahr