Skip to content
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

Merged
merged 25 commits into from
Feb 3, 2024

Conversation

aakrity17
Copy link
Collaborator

@aakrity17 aakrity17 commented Dec 14, 2023

This pull request introduces comprehensive UI tests for two essential features within the File Browser application: "Login" and "Create File."

@aakrity17 aakrity17 force-pushed the akrity-ui-test-for-login branch 2 times, most recently from 4db8c45 to 783895e Compare December 14, 2023 08:39
@aakrity17 aakrity17 changed the title Akrity UI test for login Testing Login and File Feature of File Browser Dec 19, 2023
@aakrity17 aakrity17 changed the title Testing Login and File Feature of File Browser UI test for "Login" and "Create File" Feature of File Browser Dec 19, 2023
@@ -0,0 +1,34 @@
const { expect } = require("playwright/test")


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines 6 to 8

//define selectors
// this.newFolderSelector = '//button[@title="New folder"]'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//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"]'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// this.textFieldSelector= '//div[@class="ace_content"]'

Comment on lines 29 to 31



Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change



}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

await page.fill(this.passwordSelector, password);
await page.click(this.loginButtonSelector);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines 12 to 13
}
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
);
});

Comment on lines 18 to 19
}
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
);
});

const { Given, When, Then } = require('@cucumber/cucumber')
const { expect } = require("@playwright/test")
const assert = require("assert")
const LoginPage = require("../PageObjects/LoginPage.js")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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")

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

//launch url
this.serverUrl = 'http://localhost:8080/';
this.loginUrl = this.serverUrl+"login";
// this.loginUrl = this.serverUrl+"login";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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
Copy link
Owner

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

Suggested change
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"
Copy link
Owner

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

Suggested change
When user logs in with username "admin123" and password "12345"
When user logs in with username "admin" and password "admin"

akriti/.gitignore Outdated Show resolved Hide resolved
@aakrity17 aakrity17 force-pushed the akrity-ui-test-for-login branch from a4aaee8 to c67d694 Compare December 20, 2023 09:50
@nabim777 nabim777 force-pushed the akrity-ui-test-for-login branch 2 times, most recently from 1cbeaf6 to fb9fcd1 Compare February 3, 2024 13:38
@nabim777 nabim777 force-pushed the akrity-ui-test-for-login branch from fb9fcd1 to 54ab73b Compare February 3, 2024 13:39
@nabim777 nabim777 merged commit def7e9b into master Feb 3, 2024
1 check passed
@nabim777 nabim777 deleted the akrity-ui-test-for-login branch September 15, 2024 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants