【发布时间】:2019-11-06 00:41:17
【问题描述】:
我正在尝试使用Page Object Model 模式准备端到端测试。我使用 Protractor 在 TypeScript 中编写测试。
我注意到每个测试规范文件的前几行看起来非常相似:
// repeated in almost every test spec file
import { protractor, browser, element, by, promise } from 'protractor';
const EC = protractor.ExpectedConditions;
const until = protractor.until;
// this is changing from test to test
const SomePage = require('./pages/99-SomePage');
// code with `describe` and `it`
可以不重复那些imports和const吗?
我尝试require 单独包含它们的文件,但它们似乎没有包含在我的文件中。也不可能将Export 修饰符包含到import
【问题讨论】:
标签: typescript protractor