2021-02-10 15:45:42 +01:00
|
|
|
/* global cy */
|
|
|
|
|
|
|
|
const projects = {
|
|
|
|
superBlock: 'machine-learning-with-python',
|
|
|
|
block: 'machine-learning-with-python-projects',
|
|
|
|
challenges: [
|
2021-04-22 18:23:55 +02:00
|
|
|
{
|
|
|
|
slug: 'book-recommendation-engine-using-knn',
|
|
|
|
nextChallengeText: 'Linear Regression Health Costs Calculator'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
slug: 'cat-and-dog-image-classifier',
|
|
|
|
nextChallengeText: 'Book Recommendation Engine using KNN'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
slug: 'linear-regression-health-costs-calculator',
|
|
|
|
nextChallengeText: 'Neural Network SMS Text Classifier'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
slug: 'neural-network-sms-text-classifier',
|
|
|
|
nextChallengeText: 'Find the Symmetric Difference'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
slug: 'rock-paper-scissors',
|
|
|
|
nextChallengeText: 'Cat and Dog Image Classifier'
|
|
|
|
}
|
2021-02-10 15:45:42 +01:00
|
|
|
]
|
|
|
|
};
|
|
|
|
describe('project submission', () => {
|
|
|
|
// NOTE: this will fail once challenge tests are added.
|
|
|
|
it('Should be possible to submit Python projects', () => {
|
|
|
|
const { superBlock, block, challenges } = projects;
|
2021-04-22 18:23:55 +02:00
|
|
|
challenges.forEach(({ slug }) => {
|
|
|
|
const url = `/learn/${superBlock}/${block}/${slug}`;
|
|
|
|
cy.visit(url);
|
2021-02-10 15:45:42 +01:00
|
|
|
cy.get('#dynamic-front-end-form')
|
|
|
|
.get('#solution')
|
|
|
|
.type('https://repl.it/@camperbot/python-project#main.py');
|
|
|
|
|
|
|
|
cy.contains("I've completed this challenge").click();
|
2021-04-22 18:23:55 +02:00
|
|
|
cy.contains('Go to next challenge');
|
|
|
|
// clicking on 'Go to next challenge' seems to have caused flakiness, so
|
|
|
|
// it's commented out until we figure out why.
|
|
|
|
// cy.contains('Go to next challenge').click();
|
|
|
|
|
|
|
|
// The next two commands are to confirm that go to next challenge has
|
|
|
|
// moved us to the expected challenge before we loop again.
|
|
|
|
// cy.get('.title-text').should('include.text', nextChallengeText);
|
|
|
|
// cy.url().should('not.have.string', url);
|
2021-02-10 15:45:42 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|