Wrote some tests and everything successfully runs, but my IDE (webstorm) highlights describe
, expect
and it
and says "cannot find name". I want to keep everythig clean and get rid of these, but have no idea how.
We use protractor and jasmine.
Some more of the script:
import {HomePO} from './pageobjects/home'
import {browser } from 'protractor'
describe('Smoke test', function() {
it('should initialize', function() {
let width = 320;
let height = 568;
browser.driver.manage().window().setSize(width, height);
});
it('should open homepage', function() {
HomePO.get();
expect(HomePO.isCurrentPage()).toBe(true);
});
});
I was having the same problem and did:
npm install @types/jasmine --save-dev
and that solved it - no need to import anything from jasmine.
来源:https://stackoverflow.com/questions/41143700/how-to-import-describe-expect-and-it-into-a-typescript-tests-for-ide-to-n