Test Overview
This test verifies that a user can successfully create a new workspace in Postman and that the workspace appears in the workspace list.
This test verifies that a user can successfully create a new workspace in Postman and that the workspace appears in the workspace list.
import unittest from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC class TestPostmanWorkspaceCreation(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome() self.driver.get('https://web.postman.co/') self.wait = WebDriverWait(self.driver, 10) # Assume user is already logged in for simplicity def test_create_workspace(self): driver = self.driver wait = self.wait # Click on workspace dropdown workspace_dropdown = wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, 'button[aria-label="Workspace selector"]'))) workspace_dropdown.click() # Click on 'Create Workspace' button create_workspace_btn = wait.until(EC.element_to_be_clickable((By.XPATH, '//button[contains(text(), "Create Workspace")]'))) create_workspace_btn.click() # Enter workspace name name_input = wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, 'input[placeholder="Workspace name"]'))) workspace_name = 'Test Workspace' name_input.send_keys(workspace_name) # Select workspace type (Personal) personal_radio = wait.until(EC.element_to_be_clickable((By.XPATH, '//label[contains(text(), "Personal")]'))) personal_radio.click() # Click 'Create Workspace' confirm button confirm_btn = wait.until(EC.element_to_be_clickable((By.XPATH, '//button[contains(text(), "Create Workspace")]'))) confirm_btn.click() # Verify new workspace appears in workspace list workspace_dropdown.click() workspace_list = wait.until(EC.presence_of_all_elements_located((By.CSS_SELECTOR, 'div[role="list"] div[role="listitem"]'))) workspace_names = [item.text for item in workspace_list] self.assertIn(workspace_name, workspace_names) def tearDown(self): self.driver.quit() if __name__ == '__main__': unittest.main()
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts and opens Chrome browser to Postman web app | Browser opened at https://web.postman.co/ with login page or main page | - | PASS |
| 2 | Clicks on workspace dropdown button to open workspace list | Workspace dropdown menu is visible | - | PASS |
| 3 | Clicks on 'Create Workspace' button in dropdown | Create Workspace modal/dialog appears | - | PASS |
| 4 | Enters 'Test Workspace' into workspace name input field | Input field contains 'Test Workspace' | - | PASS |
| 5 | Selects 'Personal' workspace type radio button | 'Personal' option is selected | - | PASS |
| 6 | Clicks 'Create Workspace' confirm button | Modal closes, workspace is created | - | PASS |
| 7 | Clicks workspace dropdown again to refresh workspace list | Workspace dropdown menu is visible with updated list | Check if 'Test Workspace' is in the workspace list | PASS |