} placement="bottom-start">
diff --git a/packages/bruno-app/src/components/Welcome/index.js b/packages/bruno-app/src/components/Welcome/index.js
index b893684e8..09801843a 100644
--- a/packages/bruno-app/src/components/Welcome/index.js
+++ b/packages/bruno-app/src/components/Welcome/index.js
@@ -73,23 +73,23 @@ const Welcome = () => {
- setCreateCollectionModalOpen(true)}>
+ setCreateCollectionModalOpen(true)}>
Create Collection
- setAddCollectionToWSModalOpen(true)}>
+ setAddCollectionToWSModalOpen(true)}>
Add Collection to Workspace
- Import Collection
+ Import Collection
- Load Sample Collection
+ Load Sample Collection
diff --git a/tests/home.spec.js b/tests/home.spec.js
index 7509e62b7..de85ae11a 100644
--- a/tests/home.spec.js
+++ b/tests/home.spec.js
@@ -14,6 +14,7 @@ test.describe('bruno e2e test', () => {
test('user should be able to load & use sample collection', async () => {
await homePage.loadSampleCollection();
+ await expect(homePage.loadSampleCollectionToastSuccess).toBeVisible();
await homePage.getUsers();
await expect(homePage.statusRequestSuccess).toBeVisible();
@@ -31,4 +32,9 @@ test.describe('bruno e2e test', () => {
await expect(homePage.statusRequestSuccess).toBeVisible();
});
+ test('user should be able to create new collection', async () => {
+ await homePage.createCollection('test');
+ await expect(homePage.createCollectionToastSuccess).toBeVisible();
+ })
+
});
diff --git a/tests/pages/home.page.js b/tests/pages/home.page.js
index abcfc9df4..c0357cb16 100644
--- a/tests/pages/home.page.js
+++ b/tests/pages/home.page.js
@@ -1,17 +1,32 @@
exports.HomePage = class HomePage {
constructor(page) {
this.page = page;
- this.loadSampleCollectionSelector = page.getByText('Load Sample Collection');
- this.sampeCollectionSelector = page.getByText('sample-collection');
+
+ // welcome
+ this.createCollectionSelector = page.locator('#create-collection');
+ this.addCollectionSelector = page.locator('#add-collection');
+ this.importCollectionSelector = page.locator('#import-collection');
+ this.loadSampleCollectionSelector = page.locator('#load-sample-collection');
+
+ // sample collection
+ this.loadSampleCollectionToastSuccess = page.getByText('Sample Collection loaded successfully');
+ this.sampeCollectionSelector = page.locator('#sidebar-collection-name');
this.getUsersSelector = page.getByText('Users');
this.getSingleUserSelector = page.getByText('Single User');
this.getUserNotFoundSelector = page.getByText('User Not Found');
this.postCreateSelector = page.getByText('Create');
this.putUpdateSelector = page.getByText('Update');
- this.sendRequestButton = page.locator('div:nth-child(2) > .flex > svg');
+
+ // request panel
+ this.sendRequestButton = page.locator('#send-request');
this.statusRequestSuccess = page.getByText('200 OK');
this.statusRequestNotFound = page.getByText('404 Not Found');
this.statusRequestCreated = page.getByText('201 Created');
+
+ // create collection
+ this.collectionNameField = page.locator('#collection-name');
+ this.submitButton = page.locator(`button[type='submit']`);
+ this.createCollectionToastSuccess = page.getByText('Collection created');
}
async open() {
@@ -47,4 +62,10 @@ exports.HomePage = class HomePage {
await this.putUpdateSelector.click();
await this.sendRequestButton.click();
}
+
+ async createCollection(collectionName) {
+ await this.createCollectionSelector.click();
+ await this.collectionNameField.fill(collectionName);
+ await this.submitButton.click();
+ }
}