# ember-formulaic **Repository Path**: mirrors_thoughtbot/ember-formulaic ## Basic Information - **Project Name**: ember-formulaic - **Description**: Simplify form filling in acceptance tests - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-18 - **Last Updated**: 2026-04-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Ember-Formulaic Simplify form filling with i18n translations. Remove the tedium of formulaic form filling with Ember Test Helpers Formulaic allows you to specify a hash of attributes to be input rather than procedurally calling Ember’s DSL methods. ## Usage First, import the test helpers: ```js // tests/start-app.js import './ember-formulaic/test-helpers'; ``` Assume the page has the following template: ```hbs {{! app/templates/login.hbs }}
{{input id="email" type="text" value=email}}
{{input id="password" type="password" value=password}}
{{input id="remember-me" type="checkbox" value=remember}}
``` and the following translations: ```js // app/locales/en/translations.js export default { 'login': { 'email': 'Email or Username', 'password': 'Password', 'remember-me': 'Remember Me', 'role': 'Role', 'submit': 'Login', } }; ``` In your acceptance test, use the `fillForm` method: ```js // test/acceptance/fill-in-form-test.js test('fill in form', function() { visit('/login') // with the 'login' namespace fillForm('login', { email: 'ralph@thoughtbot.com', password: 'secret', remember-me: true, role: 'user', }); // without a namespace fillForm({ 'login.email': 'ralph@thoughtbot.com', 'login.password': 'secret', 'login.remember-me': true, 'login.role': 'user', }); clickOn('form.submit'); andThen(function() { equal(currentPath(), 'loggedInPath'); }); }); ``` ### Translations with embedded HTML When translating a label with HTML: ```hbs