Skip to content

Commit

Permalink
Add logic to allow for flexible error status code (#1045)
Browse files Browse the repository at this point in the history
* add logic to allow for flexible error status code

* change logic

* Update OAuth2Test.js

* fix logic

* fix logic

* try grabbing text and comparing expected error

---------

Co-authored-by: Hara Prasad <haraprasadj@uchicago.edu>
  • Loading branch information
tianj7 and haraprasadj authored Jun 28, 2024
1 parent 2e3033e commit e3c44d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion services/apis/fence/fenceTasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@ module.exports = {
}
// }
} else {
I.seeTextEquals('Unauthorized', 'h2');
let errorMessage = await I.grabTextFrom('//div[@class="error-page__status-code-text"]/h2');
expect(errorMessage).to.be.oneOf(["Bad Request", "Unauthorized"]);
}
// I.saveScreenshot('consent_auth_code_flow.png');
const urlStr = await I.grabCurrentUrl();
Expand Down
2 changes: 1 addition & 1 deletion suites/apis/OAuth2Test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Scenario('Authorization code flow: Test that successfully generates code @reqGoo

Scenario('Authorization code flow: Test that fail to generate code due to not provided openid scope @reqGoogle', async ({ fence }) => {
const resULR = await fence.do.getConsentCode(
fence.props.clients.client.id, 'code', 'user', 'ok', false,
fence.props.clients.client.id, 'code', 'user', 'ok', false
);
fence.ask.assertNotContainSubStr(resULR, ['code=']);
});
Expand Down

0 comments on commit e3c44d1

Please sign in to comment.