각도기에서 내비게이션 테스트를 시도하고 있으며 구성에서 baseUrl 및 테스트에 사용 된 URL과 아무런 합의도 보이지 않습니다.각도기에서 실행중인 테스트에 사용 된 기본 URL을 어떻게 알 수 있습니까?
protractor.conf.js
exports.config = {
baseUrl: 'http://localhost:4200/'
}
navbar.e2e-spec.ts
import { NavbarPage } from './navbar.po';
import * as protractor from './../protractor.conf.js';
describe('navbar',() => {
let navbar: NavbarPage;
const baseUrl = protractor.config.baseUrl;
beforeEach(() => {
navbar = new NavbarPage();
browser.get('/');
});
it(`should see showcase nav item, be able to (click) it,
and expect to be navigated to showcase page`,() => {
const anchorShowcase = navbar.anchorShowcase;
expect(anchorShowcase.isDisplayed()).toBe(true);
anchorShowcase.click();
browser.waitForAngular();
expect(browser.getCurrentUrl()).toBe(baseUrl + '/showcase');
});
});
나는 E2E 테스트를 실행할 때 다른 포트를 사용하지만
:** NG Live Development Server is listening on localhost:49154, open your browser on http://localhost:49154/ **
을 테스트 URL을 포트 49154로 설정하는 이유는 무엇입니까? 이것은 새로운 angular-cli 프로젝트를 시작하는 경우 분명히 기본값 인 것처럼 보입니다 : https://github.com/angular/angular-cli
내 모든 각진 cli 프로젝트에 대해 안전하거나 http://localhost:49154/
을 안전하게 사용할 수 있습니까? 각도 CLI의 ng e2e
명령을 실행하는 경우