Closed ghost closed 6 years ago
@elimisteve A first test to get us on the same page.
@elimisteve If you're okay with this proof-of-concept, shall I proceed? The next steps are writing the README-TESTING.md and fleshing out the test. In particular, best practice is decoupling test logic and page-handing logic using page objects. Google "page object model" for deets, but the idea is that test files should not directly call any Webdriver code -- this lets tests remain unchanged if or when the underlying page elements change.
@elimisteve This PR, or one like it, would probably satisfy issue #66, too.
It linted noisily, but browser is, in fact, defined globally by the test runner.
Is it? I guess since browser
isn't defined in most of the .test.js
files, is why it's complaining.
...best practice is decoupling test logic and page-handing logic using page objects. ...the idea is that test files should not directly call any Webdriver code -- this lets tests remain unchanged if or when the underlying page elements change.
Sounds reasonable to me, but do you happen to have a quick example you can show me?
It linted noisily, but browser is, in fact, defined globally by the test runner.
Is it? I guess since browser isn't defined in most of the .test.js files, is why it's complaining.
That was my guess, too. The testrunner defines browser
for the test environment, but I did not know how to tell lint that. Turns out that a wdio plugin exists that does, eslint-plugin-webdriverio. Added that as a dev dependency, problem solved.
Sounds reasonable to me, but do you happen to have a quick example you can show me?
Yep. https://gist.github.com/kurtwall/baf78d670bf4e139d0e89f3c08c819e3
That's a slight modification of WDIO's example page object, not something specific to Pursuance. OTOH, what we end up with will look a lot like that.
This commit lays the groundwork for a pursuance test suite and adds a few simple tests for the login page. I've added the WebdriverIO test framework, the Chai assertion library, and some Babel support for writing ES6/ES2015 code. I'll add a README-TESTING.md soon. In the meantime, to try this out, pull the branch, say
npm install
to update the installed packages with a bunch of infrastructure, and then invoke WebdriverIO's test runner thus:I imagine we'll have some conversations about this first. :)
It linted noisily, but
browser
is, in fact, defined globally by the test runner.