Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created April 16, 2022 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save codecademydev/92b35662c0a3ea424bbc257007cec8b8 to your computer and use it in GitHub Desktop.
Save codecademydev/92b35662c0a3ea424bbc257007cec8b8 to your computer and use it in GitHub Desktop.
Codecademy export
<form>
<textarea id="quote" name="quote"></textarea>
<input id="attributed" name="attributed">
<input id="source" name="source">
<input type="submit">
</form>
<div id="quotes" name="quotes">
</div>
const {assert} = require('chai');
describe("User visits root", () => {
describe("Posting a quote", () => {
it("saves the quote and the metadata submitted by the user", () => {
const quote = "Our deepest fear is not that we are inadequate. Our deepest fear is that we are powerful beyond measure.";
const attributed = "Marianne Williamson.";
const source = "A Return to Love: Reflections on the Principles of A Course in Miracles"
browser.url("/");
browser.setValue("textarea[id=quote]", quote);
browser.setValue("input[id=attributed]", attributed);
browser.setValue("input[id=source]", source);
browser.click("input[type=submit]");
assert.include(browser.getText("#quotes"), quote);
assert.include(browser.getText("#quotes"), attributed);
assert.include(browser.getText("#quotes"), source);
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment