2022-03-22 01:05:38 -05:00
|
|
|
describe('CodeAlly cert challenge', function () {
|
|
|
|
describe('before completing the project', function () {
|
|
|
|
before(() => {
|
|
|
|
cy.exec('npm run seed');
|
|
|
|
cy.login();
|
|
|
|
cy.visit(
|
|
|
|
'/learn/relational-database/build-a-celestial-bodies-database-project/build-a-celestial-bodies-database'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not allow you to submit a URL', function () {
|
2022-04-01 00:07:01 -05:00
|
|
|
cy.get('input[name="solution"]').type('https://example.com');
|
|
|
|
|
|
|
|
// temporary fix until https://github.com/cypress-io/cypress/issues/20562 is fixed
|
|
|
|
cy.contains(`I've completed this challenge`).click();
|
|
|
|
|
|
|
|
// revert to this when it is
|
|
|
|
// .type('{enter}')
|
|
|
|
|
2022-03-22 01:05:38 -05:00
|
|
|
cy.contains('You must complete the project first.');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('after completing the project', function () {
|
|
|
|
before(() => {
|
|
|
|
cy.exec('npm run seed:certified-user');
|
|
|
|
cy.login();
|
|
|
|
cy.visit(
|
|
|
|
'/learn/relational-database/build-a-celestial-bodies-database-project/build-a-celestial-bodies-database'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should allow you to submit a URL', function () {
|
2022-04-01 00:07:01 -05:00
|
|
|
cy.get('input[name="solution"]').type('https://example.com');
|
|
|
|
|
|
|
|
// temporary fix until https://github.com/cypress-io/cypress/issues/20562 is fixed
|
|
|
|
cy.contains(`I've completed this challenge`).click();
|
|
|
|
|
|
|
|
// revert to this when it is
|
|
|
|
// .type('{enter}')
|
|
|
|
|
2022-03-22 01:05:38 -05:00
|
|
|
cy.get('.completion-modal-body');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|