-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser tests #370
Merged
Merged
Browser tests #370
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,5 @@ modernomad/local_settings.py.bak | |
ghostdriver.log | ||
.env | ||
static/CACHE/ | ||
|
||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"baseUrl": "http://localhost:8000", | ||
"projectId": "3gfovh" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/// <reference types="Cypress" /> | ||
const randomstring = require("randomstring"); | ||
|
||
describe("Booking a room", function() { | ||
it("New user flow", function() { | ||
cy.visit("/"); | ||
cy.contains("Cummings Green").click(); | ||
cy.contains("View all rooms").click(); | ||
cy.contains("Evan Johnson").click({ force: true }); | ||
|
||
cy.get("input[name=arrive]").focus(); | ||
// Pick next month so all the dates are available | ||
cy.get(".react-datepicker__navigation--next").click({ force: true }); | ||
cy.get("[aria-label=day-13]").click({ force: true }); | ||
// Force de-select first date picker. For some reason immediately selecting second date | ||
// picker causes first not to close. | ||
cy.get("#network-footer").click("topLeft"); | ||
cy.get("input[name=depart]").focus(); | ||
cy.get("[aria-label=day-16]").click({ force: true }); | ||
cy.get("[name=purpose]").type("Work."); | ||
cy.contains("Request to Book").click(); | ||
|
||
cy.get("[name=bio]").type("I am a robot."); | ||
cy.get("[name=projects]").type("Kill all humans."); | ||
cy.get("[name=sharing]").type("I can do your math homework."); | ||
cy.get("[name=discussion]").type("Is AI risk overrated?"); | ||
cy.get("[name=first_name]").type("Bot"); | ||
cy.get("[name=last_name]").type("McBotface"); | ||
cy.get("[name=referral]").type("Pixel"); | ||
cy.get("[name=city]").type("Chapek 9"); | ||
cy.get("[name=email]").type(`${randomstring.generate(10)}@example.com`); | ||
cy.get("[name=password1]").type("password"); | ||
cy.get("[name=password2]").type("password"); | ||
|
||
cy.uploadFile("profile.png", "input[name=image"); | ||
|
||
cy.contains("Submit").click(); | ||
|
||
cy.contains("Your booking has been submitted."); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// *********************************************************** | ||
// This example plugins/index.js can be used to load plugins | ||
// | ||
// You can change the location of this file or turn off loading | ||
// the plugins file with the 'pluginsFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/plugins-guide | ||
// *********************************************************** | ||
|
||
// This function is called when a project is opened or re-opened (e.g. due to | ||
// the project's config changing) | ||
|
||
module.exports = (on, config) => { | ||
// `on` is used to hook into various events Cypress emits | ||
// `config` is the resolved Cypress config | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// *********************************************** | ||
// This example commands.js shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add("login", (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is will overwrite an existing command -- | ||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) | ||
|
||
// https://github.com/cypress-io/cypress/issues/170 | ||
Cypress.Commands.add("uploadFile", (fileName, selector) => { | ||
cy.get(selector).then(subject => { | ||
cy.fixture(fileName).then(content => { | ||
Cypress.Blob.base64StringToBlob(content, "image/jpeg").then(blob => { | ||
const el = subject[0]; | ||
const testFile = new File([blob], fileName); | ||
const dataTransfer = new DataTransfer(); | ||
|
||
dataTransfer.items.add(testFile); | ||
el.files = dataTransfer.files; | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest that we use https://djangopackages.org/packages/p/django-registration/ for registration / login. If you agree let's open a new issue for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sounds good! These views looked like a bit of a mess but I didn’t want to refactor them now. 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will come a day :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes agree! this project was started before django had a registration or profile functionality built in. have been keen to move to the newer functionality.