Skip to content

Commit

Permalink
Merge pull request #703 from yeatmanlab/enh/clever-CI
Browse files Browse the repository at this point in the history
Clever CI
  • Loading branch information
lucasxsong authored Jul 10, 2024
2 parents 3bfe6ef + 70b7acf commit 8eb34a2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
27 changes: 27 additions & 0 deletions cypress/e2e/participant/default-tests/cleverSignIn.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export const timeout = Cypress.env('timeout');

describe('Cypress test to login in Clever', () => {
it('passes', () => {
cy.visit('/');
cy.wait(0.1 * timeout);
cy.get('button').contains('Clever').click();

cy.origin('https://clever.com/oauth/authorize', () => {
cy.get('input[title="School name"]', { timeout: 10000 })
.type('61e8aee84cf0e71b14295d45')
.wait(1000)
.type('{enter}');

// Find the username input field and input the username
cy.get('input#username').type('27988125011');

// Input password
cy.get('input#password').type('.EWKYDvAGNdGm!@g8a_E');

// Click the login button
cy.get('button#UsernamePasswordForm--loginButton').click();
});

cy.contains('tasks completed!', { timeout: 2 * timeout }).should('be.visible');
});
});
18 changes: 9 additions & 9 deletions src/pages/SignIn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ const authWithGoogle = () => {
if (isMobileBrowser()) {
authStore.signInWithGoogleRedirect();
} else {
// authStore.signInWithGoogleRedirect();
authStore
.signInWithGooglePopup()
.then(async () => {
Expand All @@ -133,14 +132,15 @@ const authWithGoogle = () => {
const authWithClever = () => {
console.log('---> authWithClever');
if (isMobileBrowser()) {
authStore.signInWithCleverRedirect();
spinner.value = true;
} else {
authStore.signInWithCleverRedirect();
// authStore.signInWithCleverPopup();
spinner.value = true;
}
const isLocalHost = import.meta.env.DEV;
// // if localhost or not testing, use popup
// if (isLocalHost) {
// authStore.signInWithCleverPopup();
// spinner.value = true;
// } else {
authStore.signInWithCleverRedirect();
spinner.value = true;
// }
};
const authWithClassLink = () => {
Expand Down
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
injectManifest: {
injectionPoint: undefined,
rollupFormat: 'iife',
globPatterns: ['**/*.{html}'],
globPatterns: ['**/*'],
},
manifest: {
// Modify manifest options here...
Expand Down

0 comments on commit 8eb34a2

Please sign in to comment.