How to add wait in ember cli page object testcases


#1

how to add wait in ember cli page object testcases


#2

Hello @aboli :slight_smile:

Can you please provide some more details about what you’re trying to do?

What have you already tried? What didn’t work?


#3

hello,

i am working on ember cli page object framework.

this is my page.js

import { create, clickable, fillable, visitable, triggerable

} from ‘ember-cli-page-object’;

export default create({

visit: visitable(’/createcluster’), //Users users: fillable(‘input’), enter_users: triggerable(‘keyup’, ‘input’, { eventProperties: { keyCode: 40 } }), selectall_users: clickable(‘button:contains(“Select all”)’), addall_users: clickable(‘button:contains(“Add Selected Value(s)”)’),}}

and this is my testcase

import { test } from ‘ember-qunit’; import moduleForAcceptance from ‘flamingo-ui/tests/helpers/module-for-acceptance’; import page from ‘flamingo-ui/tests/pages/createcluster’; import wait from ‘ember-test-helpers/wait’;

moduleForAcceptance(‘Acceptance | createcluster’, { acceptance : true, unit : true, integration : true, setup: function() { this.application = startApp(); server.logging = true; },

teardown: function() { Ember.run(this.application, ‘destroy’); } });

test(‘create cluster using union’, function(assert) { page .visit() .users(‘afriling’) .enter_users() .selectall_users() .addall_users(); andThen(function() { assert.equal(find(’#users > a’).text(), ‘1’); });

now, i want to wait for 2 seconds after each step given above.

i can do it in acceptance testing without ember page object model. using below commands Ember.Test.promise(function(resolve) { window.setTimeout(resolve, 2000); });

but how to make it work in page object model.


#4

@aboli Could you also add the Questions label?


#5

how to add wait in ember cli page object testcases

??


#6

how to add wait in ember cli page object testcases