-
Notifications
You must be signed in to change notification settings - Fork 342
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
Solution #301
base: main
Are you sure you want to change the base?
Solution #301
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,49 @@ | ||
describe('', () => { | ||
before(() => { | ||
/// <reference types='cypress' /> | ||
import { generateArticle } from '../support/generateArticle'; | ||
|
||
describe('Article flow', () => { | ||
const user = { | ||
email: '[email protected]', | ||
password: 'Password10@' | ||
}; | ||
|
||
const { title, description, body, tag } = generateArticle(); | ||
|
||
const articlePayload = { | ||
title, | ||
description, | ||
body, | ||
taglist: [ | ||
tag | ||
] | ||
}; | ||
|
||
beforeEach(() => { | ||
cy.login(user); | ||
cy.visit(''); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
}); | ||
|
||
it('', () => { | ||
it('should create the article', () => { | ||
cy.contains('.nav-link', 'New Article').click(); | ||
|
||
cy.get('[placeholder="Article Title"]').type(title); | ||
cy.get('[placeholder="What\'s this article about?"]') | ||
.type(description); | ||
cy.get('[placeholder="Write your article (in markdown)"]') | ||
.type(body); | ||
cy.get('[placeholder="Enter tags"]').type(`${tag}{enter}`); | ||
|
||
cy.contains('.btn', 'Publish Article').click(); | ||
|
||
cy.url().should('contain', 'article/'); | ||
}); | ||
|
||
it('', () => { | ||
it('should delete the article', () => { | ||
cy.createArticle(user, articlePayload); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
||
cy.contains('.btn', 'Delete Article').click(); | ||
|
||
cy.contains('.article-preview', 'No articles are here... yet.') | ||
.should('be.visible'); | ||
}); | ||
}); |
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.
The
cy.visit('');
command is visiting an empty URL, which might not be the intended behavior. Ensure that the correct URL or path is provided to navigate to the desired page.