Skip to content

Conversation

@rute-santos
Copy link
Contributor

No description provided.

@rute-santos rute-santos requested a review from gabeabrams July 15, 2025 20:23
Kaixa.click('.btn-primary');
boolean isHarvardKey = obj.has('isHarvardKey') && obj.getBoolean('isHarvardKey');
boolean needs2FA = isHarvardKey && obj.has('needs2FA') && obj.getBoolean('needs2FA');

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In GlobalCredentials, the user will be something like:

	public static String admin ='''
		{
		   'username': '[email protected]',
		   'password': '',
           'isHarvardKey': true,
           'needs2FA': true,
		}

I'm not attached to specific names so please suggest better ones.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this. The only thing I'm thinking is that the name isHarvardKey is confusing to me because isn't Harvard Guest part of HarvardKey? Maybe clearer would be to flip this and just call it isHarvardGuest? Or something like isOfficialHarvardKey or something

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flipping it to isHarvardGuest is good with me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now:
public static String admin ='''
{
'username': '[email protected]',
'password': 'blah',
'isHarvardGuest': true,
}

src/Kaixa.groovy Outdated
* page for the user to choose between HarvardKey and Harvard Guest credentials
*/
public static void handleHarvardKey(name) {
public static void handleHarvardKey(String name, boolean expectDiscoveryPage = true) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not detect whether there is a discovery page?

Copy link
Contributor Author

@rute-santos rute-santos Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... When I implemented this, I was thinking that it's part of the test: if the application is expecting the discovery page and there isn't one, the test would fail. But: we are not testing the Harvard login, right? So I guess it's fine. It certainly will make things simpler.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

src/Kaixa.groovy Outdated
Kaixa.waitForAtLeastOneElementPresent([
'#idp_1001962798_button', // HarvardGuest
'#idp_1824601020_button', // HarvardKey
]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be the feature you could use to check if there's a discovery page. This function returns which one appeared. You could wait for either the discovery page or the login page and handle it appropriately

Copy link
Contributor

@gabeabrams gabeabrams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! Just a couple thoughts, but nothing blocking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants