I have this cypress test where I launch Course player in a new window after clicking course name but the course player keeps on loading however if i run the same scenario manually then course player works fine., could anyone please help me why does Course Player getting stuck and how to resolve this issue? #31686
QSGProjectRepositry
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have this cypress test where I launch Course player in a new window after clicking course name but the course player keeps on loading however if i run the same scenario manually then course player works fine., could anyone please help me why does Course Player getting stuck and how to resolve this issue?
here is my code:
describe('Course Launch and completion From Learner Mode', () => {
it('Learner Login', () => {
cy.visit('https://URL/login.do', {
headers: { userAgent: 'CypressMegasiteTest' }
});
cy.readFile('cypress/fixtures/EnrollmentUserData.json').then((EnrollmentUserData) => {
cy.get('input[name="username"]').type(EnrollmentUserData.username);
cy.get('input[name="password"]').type('Admin@258');
cy.get('.btn_normal', { timeout: 15000 }).click();
cy.get('.btn_normal').contains('Continue').click();
cy.get('#welcome-bar', { timeout: 10000 }).should('be.visible').and('contain', 'Welcome back');
});
});
it('Course Launch', () => {
let launchUrl
cy.window().then(win => {
cy.stub(win, 'open', newUrl => {
launchUrl = newUrl
})
})
cy.get('.bodycourseTitle-ul').click()
cy.then(() => {
const newOrigin = launchUrl.split('?')[0]
.replace('http://', 'https://')
cy.origin(newOrigin, { args: { launchUrl } }, ({ launchUrl }) => {
cy.visit(
https://scu-qa-lms.360training.com${launchUrl}
)cy.wait(2000)
})
})
});
})
Beta Was this translation helpful? Give feedback.
All reactions