0

I am writing an acceptance test for application written in angular. I use Codeception testing framework with selenium. The test writes some text into input field and submits form. It should add new task to db through ajax api call and add new <li> element to the list of existing tasks. How would I detect that the new element was added? Here's what I've got so far:

<?php
$I = new WebGuy($scenario);
$I->wantTo('add new story');
$I->amOnPage('/');
$I->fillField('input', 'asdf');
$I->pressKey('input[name=input]', '13');
// ensure that new <li> has been added?
Daniel Pecher
  • 204
  • 2
  • 10

1 Answers1

1

you may write the code to click li using anyithe following way

//Accessing via div tages

$I->click('div div div div div ul li a');
$I->see('UNIT 1');

//Accessing via classname

$I->click('div[class="new"] div div div a');

//Accessing via div ids

$I->click('div[id=tnList] ul li a');