Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First working version #1

Merged
merged 11 commits into from
Oct 18, 2015
Merged

First working version #1

merged 11 commits into from
Oct 18, 2015

Conversation

jkrems
Copy link
Member

@jkrems jkrems commented Oct 7, 2015

Just like testiumjs/testium-driver-wd#1 but for sync. Doing both in parallel to get a feeling for what works with both.

@ghost
Copy link

ghost commented Oct 7, 2015

README.md?

import createDriver from '../../..';

test('Load example page', async t => {
const { browser } = await initTestium().then(createDriver);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EndangeredMassa This would be the interface the test framework integrations would be working against, e.g. testium-mocha:

# Preparation
npm install --save-dev testium-driver-sync testium-core
# ~= testium-mocha
initTestium = require 'testium-core'
injectBrowser = (options) ->
  -> # before hook using mocha's promise support
    initTestium(options)
      .then (testium) ->
        driverType = testium.config.get('driverType', 'sync')
        driverType = require("testium-driver-#{driverType}") if typeof driverType == 'string'
        driverType testium
      .then ({@browser}) => # injected browser

describe 'my feature', ->
  before injectBrowser()

  it 'loads a page', ->
    @browser.navigateTo '/'

@jkrems
Copy link
Member Author

jkrems commented Oct 7, 2015

@khoomeister I think it's too early for that. This is just the plumbing and the actual interface is in flux. I'll copy the docs as I copy the actual implementations. E.g. all browser.* methods are supposed to be in separate files like in testium. I just hacked in the implementations needed for a first POC test.

@jkrems
Copy link
Member Author

jkrems commented Oct 13, 2015

Now with the complete integration test suite from testium.

@jkrems
Copy link
Member Author

jkrems commented Oct 13, 2015

Now with eslint (based on airbnb styles) & fixed lint errors.

@jkrems
Copy link
Member Author

jkrems commented Oct 13, 2015

Alright! Moved testium-example-app into its own repo so we can reference it from different packages and added a README. Ready for review.

@jkrems jkrems changed the title First kind-of working version First working version Oct 13, 2015
exports._getElementWithProperty = function _getElementWithProperty(selector, property) {
var element = this._getElement(selector);
return [ element, element.get(property) ];
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, this method seems weird and redundant, and makes the code harder to read. The consumers that use it refer to the element and its property value as result[0] and result[1]. You could destructure but I feel like you should just inline.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Will switch to inlining. One of the things I should have questioned instead of blindly porting it 1:1.

@ghost
Copy link

ghost commented Oct 14, 2015

No blockers :shipit:

@jkrems
Copy link
Member Author

jkrems commented Oct 18, 2015

Added the outstanding things to groupon/testium#171, releasing a 1.0 since the remaining points are all for internals.

jkrems added a commit that referenced this pull request Oct 18, 2015
@jkrems jkrems merged commit d997125 into master Oct 18, 2015
@jkrems jkrems deleted the jk-initial branch October 18, 2015 17:54
@jkrems jkrems mentioned this pull request Oct 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant