-
Notifications
You must be signed in to change notification settings - Fork 0
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
UI test for "Login" and "Create File" Feature of File Browser #6
Conversation
4db8c45
to
783895e
Compare
@@ -0,0 +1,34 @@ | |||
const { expect } = require("playwright/test") | |||
|
|||
|
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.
|
||
//define selectors | ||
// this.newFolderSelector = '//button[@title="New folder"]' |
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.
//define selectors | |
// this.newFolderSelector = '//button[@title="New folder"]' |
this.textButtonSelector = '//input[@class="input input--block"]' | ||
this.createButtonSelector='//button[@title="Create"]' | ||
this.textFieldSelector='//textarea[@class="ace_text-input"]' | ||
// this.textFieldSelector= '//div[@class="ace_content"]' |
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.
// this.textFieldSelector= '//div[@class="ace_content"]' |
|
||
|
||
|
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 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.
await page.fill(this.passwordSelector, password); | ||
await page.click(this.loginButtonSelector); | ||
} | ||
} |
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.
} | |
} |
And the user has logged in with username "admin123" and password "12345" using webUI | ||
When the user creates a new file "test.txt" with content "Hello World!!!" | ||
Then the user should be able to see "test.txt" file | ||
|
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 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 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.
} | |
); | |
}); |
const { Given, When, Then } = require('@cucumber/cucumber') | ||
const { expect } = require("@playwright/test") | ||
const assert = require("assert") | ||
const LoginPage = require("../PageObjects/LoginPage.js") |
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.
const LoginPage = require("../PageObjects/LoginPage.js") | |
const LoginPage = require("../PageObjects/LoginPage.js") |
const { expect } = require("@playwright/test") | ||
const assert = require("assert") | ||
const LoginPage = require("../PageObjects/LoginPage.js") | ||
|
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.
//launch url | ||
this.serverUrl = 'http://localhost:8080/'; | ||
this.loginUrl = this.serverUrl+"login"; | ||
// this.loginUrl = this.serverUrl+"login"; |
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.
// this.loginUrl = this.serverUrl+"login"; |
|
||
Scenario: creates a new text file | ||
Given the user has browsed to the login page | ||
And the user has logged in with username "admin123" and password "12345" using webUI |
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.
make admin id and password as default otherwise It will came problem in CI
And the user has logged in with username "admin123" and password "12345" using webUI | |
And the user has logged in with username "admin" and password "admin" using webUI |
|
||
|
||
Scenario: User Login with correct username and valid password | ||
When user logs in with username "admin123" and password "12345" |
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.
same comment https://github.com/nabim777/mentorship2023/pull/6/files#r1432036807
When user logs in with username "admin123" and password "12345" | |
When user logs in with username "admin" and password "admin" |
a4aaee8
to
c67d694
Compare
1cbeaf6
to
fb9fcd1
Compare
fb9fcd1
to
54ab73b
Compare
This pull request introduces comprehensive UI tests for two essential features within the File Browser application: "Login" and "Create File."