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

feat: use bluebird instead q #155

Closed
wants to merge 9 commits into from
Closed

feat: use bluebird instead q #155

wants to merge 9 commits into from

Conversation

DudaGod
Copy link
Member

@DudaGod DudaGod commented Jun 27, 2017

And also use 'AsyncEmitter', 'PassthroughEmitter', 'promiseUtils' from gemini-core. Instead of qemitter and q-promise-utils libraries

};

function emitBrowserEvent(emitter, browser, event) {
return emitter.emitAndWait(event, browser.publicAPI, {browserId: browser.id});
const browserSession = Object.assign(browser.publicAPI, {browserId: browser.id});
Copy link
Member Author

Choose a reason for hiding this comment

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

В текущей реализации passthrough-emitter-а - https://github.com/gemini-testing/gemini-core/blob/3979b225ff19b10475ae96a1de879a4019e141ee/lib/passthrough-emitter/index.js
ожидается, что метод emitAndWait будет вызываться с двумя аргументами. В данном случае SESSION_START и SESSION_END эмитится с 3 аргументами. Мое предложение объединть wd и id браузера в один объект. Сейчас я модифицирую wd, т.к. у нас сейчас старая версия лодаша. В отдельном PR-е перееду на последнюю версию лодаша и тогда тут можно будет юзнуть так:

const browserSession = _.extend({browserId: browser.id}, browser.publicAPI);

Так же полистал по плагинам, третий аргумент юзают только stat-reporter и url-decorator.

Copy link
Member Author

Choose a reason for hiding this comment

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

фигню какую-то написал, так работать не будет. Так как лодашовский extend не добавит к новому объекту все методы инстанса webdriverio. Поэтому пока оставлю текущий вариант:

const browserSession = Object.assign(browser.publicAPI, {browserId: browser.id});

let events = _.assign(getSyncEvents(), getAsyncEvents());

Object.defineProperty(events, 'getSync', {value: getSyncEvents, enumerable: false});
Object.defineProperty(events, 'getAsync', {value: getAsyncEvents, enumerable: false});
Object.defineProperty(events, 'getAll', {value: getAllEvents, enumerable: false});
Copy link
Member

Choose a reason for hiding this comment

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

давай тогда здесь просто get

Copy link
Member Author

Choose a reason for hiding this comment

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

давай

@j0tunn
Copy link
Contributor

j0tunn commented Aug 22, 2017

надо рибейзить

@j0tunn
Copy link
Contributor

j0tunn commented Feb 8, 2019

@DudaGod Здесь кажется проще новый PR создать, чем этот отрибейзить

@j0tunn j0tunn closed this Feb 8, 2019
@kvmamich kvmamich deleted the feature/use-bluebird branch July 8, 2019 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants