match english and croatian translation with same pattern
[angular-drzb] / test / e2e / scenarios.js
index 731d2a5..15036e6 100644 (file)
@@ -2,7 +2,7 @@
 
 /* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
 
-describe('my app', function() {
+describe('myApp', function() {
 
   beforeEach(function() {
     browser().navigateTo('/lang/en-dev/drzb2013.html?test=mock');
@@ -23,7 +23,7 @@ describe('my app', function() {
 
     it('should render registration when user navigates to /registration', function() {
       expect(element('[ng-view]').text()).
-        toMatch(/Registration/);
+        toMatch(/Registra/);
     });
 
     it('has warning box', function() {
@@ -49,6 +49,32 @@ describe('my app', function() {
 //             expect(r.row(0)).toEqual({});
        });
 
+       var registration_url;
+
+       it('accomp draft', function() {
+               input('user.registration_type').select('accomp');
+               input('user.firstname').enter('Test');
+               input('user.surname').enter('Registration');
+               input('user.city').enter('TEST');
+               input('user.email').enter('test.registration@example.com');
+
+               element('button#update-draft').click();
+               expect(element('[ng-view]').text()).toMatch(/draft/i);
+               expect(browser().location().url()).toMatch(/draft/);
+               element('#edit-registration').click();
+               expect(browser().location().url()).toMatch(/registration/);
+               registration_url = browser().location().url();
+       });
+
+       it('accomp finish registration', function() {
+               browser().navigateTo( '#' + registration_url.value );
+               expect(browser().location().url()).toBe(registration_url.value);
+               input('user.reception').select('no');
+               input('user.dinner').select('no');
+               element('#update-registration').click();
+               expect(browser().location().url()).toMatch(/confirmation/);
+       });
+
   });