Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Commit

Permalink
Merge 7c47ff7 into 9e00603
Browse files Browse the repository at this point in the history
  • Loading branch information
porterbot committed May 18, 2015
2 parents 9e00603 + 7c47ff7 commit 08498fa
Show file tree
Hide file tree
Showing 9 changed files with 221 additions and 49 deletions.
44 changes: 44 additions & 0 deletions test/functional/cucumber/EditErrorVerification.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#https://github.com/cfpb/hmda-pilot/issues/122
#https://github.com/cfpb/hmda-pilot/issues/165
#https://github.com/cfpb/hmda-pilot/issues/166

Feature: User has to provide verification for all quality errors, MSA, and Q029 edit errors
As a user
I want to verify all quality errors, MSA, and Q029 edit errors
So that I have can submit my verified .dat file for completion

Scenario: Confirming inability to complete without verification of quality edit errors
Given that I am at the HMDA homepage
When I upload the 'quality/Q001.dat' file for validation
And I click the submit button
And I continue to the quality and macro edit reports page
Then I am unable to continue to the next page

Scenario: Verifying quality edit errors
Given that I am at the HMDA homepage
When I upload the 'quality/Q001.dat' file for validation
And I click the submit button
And I continue to the quality and macro edit reports page
And I correct all quality errors
And I correct all macro errors
Then I can continue to the next page

Scenario: Verifying Q595 edit errors
Given that I am at the HMDA homepage
When I upload the 'Q595.dat' file for validation
And I click the submit button
And I continue through the quality macro errors page
And I click on the 'Q595' report link
And I correct all report errors
Then I can continue to the IRS report

Scenario: Verifying Q029 edit errors
Given that I am at the HMDA homepage
When I upload the 'Q029.dat' file for validation
And I click the submit button
And I continue to the msa and irs edit reports page
And I click on the 'Q029' report link
And I correct all report errors
Then I can continue to the IRS report


14 changes: 0 additions & 14 deletions test/functional/cucumber/HighLevelMSA_IRS.feature

This file was deleted.

15 changes: 0 additions & 15 deletions test/functional/cucumber/MacroEditReport.feature

This file was deleted.

15 changes: 0 additions & 15 deletions test/functional/cucumber/QualityEditReport.feature

This file was deleted.

46 changes: 42 additions & 4 deletions test/functional/cucumber/WizardNavigation.feature
Original file line number Diff line number Diff line change
@@ -1,12 +1,50 @@
#https://github.com/cfpb/hmda-pilot/issues/155

@wip
Feature: Display edit validation steps using a wizard
As a user
I want to see the steps involved in validating my HMDA file
So that I know what is coming next
So that I know what is coming next and can navigate backwards to any step in the wizard

Scenario: Receive electronic report
Scenario: Navigate from syntactical page
Given that I am at the HMDA homepage
When I upload the 'quality/q001.dat' file for validation
When I click the localDB storage option
And I upload the 'perfect.dat' file for validation
And I click the submit button
And I continue to the syntactical and validity edit reports page
Then I see a navigation wizard
And I can reset my session by clicking on the 'Select File' Tab

Scenario: Navigate from quality page
Given that I am at the HMDA homepage
When I click the localDB storage option
And I upload the 'perfect.dat' file for validation
And I click the submit button
And I continue to the quality and macro edit reports page
Then I see a navigation wizard
And I can navigate to the 'summarySyntacticalValidity' page by clicking the 'Syntactical & validity edit reports' Tab
And I can reset my session by clicking on the 'Select File' Tab

Scenario: Navigate from msa and irs page
Given that I am at the HMDA homepage
When I click the localDB storage option
And I upload the 'perfect.dat' file for validation
And I click the submit button
And I continue to the msa and irs edit reports page
Then I see a navigation wizard
And I can navigate to the 'summaryQualityMacro' page by clicking the 'Quality & macro edit reports' Tab
And I can navigate to the 'summarySyntacticalValidity' page by clicking the 'Syntactical & validity edit reports' Tab
And I can reset my session by clicking on the 'Select File' Tab

Scenario: Navigate from validation summary page
Given that I am at the HMDA homepage
When I click the localDB storage option
And I upload the 'perfect.dat' file for validation
And I click the submit button
And I continue to the msa and irs edit reports page
And I click on the 'IRS' report link
And I verify the 'IRS' report and continue
Then I see a navigation wizard
And I can navigate to the 'summaryMSA-IRS' page by clicking the 'MSA and IRS reports' Tab
And I can navigate to the 'summaryQualityMacro' page by clicking the 'Quality & macro edit reports' Tab
And I can navigate to the 'summarySyntacticalValidity' page by clicking the 'Syntactical & validity edit reports' Tab
And I can reset my session by clicking on the 'Select File' Tab
66 changes: 65 additions & 1 deletion test/functional/cucumber/step_definitions/changePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module.exports = function() {
var continueThroughQualityErrors = function() {
element.all(by.partialLinkText('Q0')).then(function(macroErrors) {
macroErrors[0].click();
verifyMacroErrors (0, macroErrors.length).then(function() {
verifyMacroErrors(0, macroErrors.length).then(function() {
continueButton.click();
waitForNextPage(next);
});
Expand All @@ -136,4 +136,68 @@ module.exports = function() {
waitForNextPage(continueThroughQualityErrors);
});
});

this.When(/^I correct all macro errors$/, function(next) {
element(by.id('macro')).all(by.partialLinkText('Q0')).then(function(macroErrors) {
macroErrors[0].click();
verifyMacroErrors(0, macroErrors.length).then(function() {
next();
});
});
});

this.When(/^I correct all quality errors$/, function(next) {
var verifyAndContinue = function(index, numErrors, callback) {
element(by.model('response.verified')).click().then(function() {
element(by.buttonText('Save and continue')).click();
waitForNextPage(function() {
if (index === numErrors) {
next();
} else {
callback(index + 1, numErrors);
}
});
});
};

var continueThroughQualityErrors = function(index, numErrors) {
element(by.binding('entries')).getText().then(function(actualCount) {
element(by.model('$parent.paginate.pageSize')).$('option:checked').getText().then(function(pageSize) {
var totalPages = actualCount.match(/\((.+?) /)[1] / pageSize;
if (totalPages > 1) {
element(by.model('currentPage')).clear();
element(by.model('currentPage')).sendKeys(totalPages).then(function() {
element(by.css('.pagination_submit')).click();
verifyAndContinue(index, numErrors, continueThroughQualityErrors);
});
} else {
verifyAndContinue(index, numErrors, continueThroughQualityErrors);
}
});
});
};

element(by.id('quality')).all(by.partialLinkText('Q0')).then(function(qualityErrors) {
qualityErrors[0].click();
continueThroughQualityErrors(0, qualityErrors.length);
});
});

this.When(/^I correct all report errors$/, function(next) {
// for now this means just visiting the page
element(by.buttonText('Save and continue')).click();
waitForNextPage(next);
});

this.When(/^I verify the 'IRS' report and continue$/, function(next) {
browser.getCurrentUrl().then(function(url) {
currentPage = url;
element(by.id('verify')).click();
element(by.buttonText('Save and continue')).click();
waitForNextPage(function() {
continueButton.click();
waitForNextPage(next);
});
});
});
};
26 changes: 26 additions & 0 deletions test/functional/cucumber/step_definitions/errorVerification.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* jshint expr:true, -W079 */
'use strict';

var chai = require('chai'),
expect = chai.expect,
chaiAsPromised = require('chai-as-promised');

chai.use(chaiAsPromised);

module.exports = function() {
this.Then(/^I am unable to continue to the next page$/, function(next) {
element.all(by.css('.btn__disabled')).then(function(continueButton) {
continueButton[0].getText().then(function(text) {
expect(text).is.equal('Continue');
next();
});
});
});

this.Then(/^I can continue to the next page$/, function(next) {
element.all(by.css('.btn__disabled')).count().then(function(count) {
expect(count).is.equal(0);
next();
});
});
};
4 changes: 4 additions & 0 deletions test/functional/cucumber/step_definitions/msaIRSPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ module.exports = function() {
expect(element(by.id(reportName)).isPresent()).to.eventually.be.true.notify(next);
});

this.Then(/^I can continue to the IRS report$/, function(next) {
expect(element(by.linkText('IRS')).isPresent()).to.eventually.be.true.notify(next);
});

this.Then(/^I will see a certification of accuracy$/, function(next) {
expect(element(by.id('verify')).isPresent()).to.eventually.be.true.notify(next);
});
Expand Down
40 changes: 40 additions & 0 deletions test/functional/cucumber/step_definitions/navigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* jshint expr:true, -W079 */
'use strict';

var chai = require('chai'),
expect = chai.expect,
chaiAsPromised = require('chai-as-promised');

chai.use(chaiAsPromised);

module.exports = function() {
this.Then(/^I see a navigation wizard$/, function(next) {
expect(element(by.css('.step')).isPresent()).to.eventually.be.true.notify(next);
});

this.Then(/^I can reset my session by clicking on the 'Select File' Tab$/, function(next) {
element.all(by.css('.step-title')).filter(function(step) {
return step.getText().then(function(stepTitle) {
return (stepTitle === 'Select file & validate');
});
}).then(function(selectFileStep) {
selectFileStep[0].click();
expect(element(by.css('.btn__warning')).isPresent()).to.eventually.be.true.notify(next);
});
});

this.Then(/^I can navigate to the '([^']*)' page by clicking the '([^']*)' Tab$/, function(pageUrl, targetStepTitle, next) {
element.all(by.css('.step-title')).filter(function(step) {
return step.getText().then(function(stepTitle) {
return (stepTitle === targetStepTitle);
});
}).then(function(selectFileStep) {
selectFileStep[0].click();
browser.getCurrentUrl().then(function(url) {
var targetUrl = browser.baseUrl + '#/' + pageUrl;
expect(url).to.equal(targetUrl);
next();
});
});
});
};

0 comments on commit 08498fa

Please sign in to comment.