0

I'm a codeception newbie, I have try to do a simple acceptance test, but not work. I need your help, thanks. I refer to this [video]

This is my WelcomeCept.php

<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('create account');
$I->see('Create Account', 'a[href="simple/bootstrap"]');
$I->click('Create Account', 'a[href="simple/bootstrap"]');
$I->see('Username');
$I->fillField('Username', 'test');
$I->fillField('Email', 'test@gmail.com');
$I->fillField('Password', '123456');
$I->click('Create');
$I->see('create success');

And this is my config

class_name: AcceptanceTester
modules:
    enabled:
        - PhpBrowser
        - AcceptanceHelper
    config:
        PhpBrowser:
            url: 'http://localhost/ciexample/simple/read_account'

And I input this command

$ ./vendor/bin/codecept run --steps

I get just one request, I have no idea. I don't get any error message.

Codeception PHP Testing Framework v2.0.4
Powered by PHPUnit 4.2.2 by Sebastian Bergmann.

Acceptance Tests (1) ------------------------------------------------------------------------------------------------------------
Trying to create account (WelcomeCept)
Scenario:
* I see "Create Account","a[href="simple/bootstrap"]"
lighter
  • 2,808
  • 3
  • 40
  • 59

1 Answers1

0

I know this question, I miss amOnPage(). And I should not use fillField, because phpbrowser can't work on fillField. I refer this [answer]

$I->wantTo('view all data');
$I->amOnPage('/read_account'); // I miss this 
$I->see('Create Account', 'a[href="simple/bootstrap"]');
Community
  • 1
  • 1
lighter
  • 2,808
  • 3
  • 40
  • 59