- работа с роутингом:
amOnRoute
,getUrlByRoute
- @notgosu (Паша Науменко)
- acceptance tests -
- functional tests -
const inventory = [ | |
{ name: 'sword', weight: 3}, | |
{ name: 'pickaxe', weight: 2}, | |
{ name: 'bow', weight: 1}, | |
] | |
var inventoryWeight = 0; | |
function addToInventory(item) { | |
// if weight of items in inventory | |
// less than 10 |
# run it as DEBUG=true rails test | |
if ENV['DEBUG'] | |
Rails.logger = Logger.new(STDOUT) | |
Rails.logger.level = Logger::INFO | |
Rails.logger.datetime_format = "" | |
Rails.logger.formatter = proc do |severity, _time, _progname, msg| | |
"#{severity.green}: #{msg}\n" | |
end | |
<?php | |
namespace Codeception\Module; | |
use Codeception\Exception\ConfigurationException; | |
use Codeception\Exception\ModuleException; | |
use Codeception\Test\Test; | |
use Codeception\TestInterface; | |
use PhpPact\Consumer\Model\Interaction; | |
use PhpPact\Exception\ConnectionException; | |
use PhpPact\Http\GuzzleClient; |
import Controller from '@ember/controller'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
get model() { | |
return [{ | |
id: 1, | |
name: 'Write tests from scratch', | |
isVisible: true, |
<form method="post" action="/update" id="update_form"> | |
<label for="user_name">Name</label> | |
<input type="text" name="user[name]" id="user_name" /> | |
<label for="user_email">Email</label> | |
<input type="text" name="user[email]" id="user_email" /> | |
<label for="user_role">Role</label> | |
<select id="user_role" name="user[role]"> | |
<option value="0">Admin</option> | |
<option value="1">User</option> | |
</select> |
<?php | |
use Codeception\TestInterface; | |
use FR3D\SwaggerAssertions\PhpUnit\AssertsTrait; | |
use FR3D\SwaggerAssertions\SchemaManager; | |
class Api extends \Codeception\Module | |
{ | |
use AssertsTrait; | |
public function _before(TestInterface $test) |
<?php | |
namespace Helper; | |
// here you can define custom actions | |
// all public methods declared in helper class will be available in $I | |
class Raml extends \Codeception\Module | |
{ | |
public function parseSchemaFor($type) | |
{ |
it('should create todo item', (I) => { | |
browser.get("http://todomvc.com/examples/angularjs/#/"); | |
expect(element(by.css("#todo-count")).isPresent()).toBeFalsy(); | |
var inputField = element(by.model("newTodo")); | |
inputField.sendKeys("Write a guide"); | |
inputField.sendKeys(protractor.Key.ENTER); | |
var todos = element.all(by.repeater("todo in todos")); | |
expect(todos.last().getText()).toEqual("Write a guide")); | |
element(by.css("#todo-count")).getText()).toContain('1 items left'); | |
}); |
..00Ooo... | |
.Oo... | |
.o0o00oo... | |
o.. .0OoO0Ooo00Ooo... o | |
0Ooo.. + (x) | |
0ooooooo.. /_\ ( |x) |