All folders and files have been renamed following modern TypeScript conventions.
Renamed interfaces and locators folders and their files to more meaningful, modern names following TypeScript best practices.
interfaces/folder - Generic name, doesn't convey purpose- "I" prefix on interfaces - Outdated C# convention, not modern TypeScript practice
*Locators.tssuffix - Verbose,*Elements.tsor just the page name is clearer- Redundant "Page" in locator classes -
LoginPageLocators→LoginPageElements(already done) but file name should match
interfaces/ → contracts/
pages/locators/ → pages/elements/
IDeleteCustomerPage.ts → deleteCustomer.contract.ts
IEditCustomerPage.ts → editCustomer.contract.ts
IHomePage.ts → home.contract.ts
ILoginPage.ts → login.contract.ts
INewCustomerPage.ts → newCustomer.contract.ts
ITestUtil.ts → testUtil.contract.ts
Benefits:
.contract.tssuffix clearly indicates these are interface contracts- Removes outdated "I" prefix
- Follows modern TypeScript conventions
- More concise file names
DeleteCustomerPageLocators.ts → deleteCustomer.elements.ts
EditCustomerPageLocators.ts → editCustomer.elements.ts
HomePageLocators.ts → home.elements.ts
LoginPageLocators.ts → login.elements.ts
NewCustomerPageLocators.ts → newCustomer.elements.ts
Benefits:
.elements.tsclearly indicates these are element definitions- Consistent with page action files
- More concise
interfaces/ → types/
pages/locators/ → pages/selectors/
IDeleteCustomerPage.ts → DeleteCustomerPage.ts
IEditCustomerPage.ts → EditCustomerPage.ts
IHomePage.ts → HomePage.ts
ILoginPage.ts → LoginPage.ts
INewCustomerPage.ts → NewCustomerPage.ts
ITestUtil.ts → TestUtil.ts
DeleteCustomerPageLocators.ts → DeleteCustomerPageSelectors.ts
EditCustomerPageLocators.ts → EditCustomerPageSelectors.ts
HomePageLocators.ts → HomePageSelectors.ts
LoginPageLocators.ts → LoginPageSelectors.ts
NewCustomerPageLocators.ts → NewCustomerPageSelectors.ts
If you prefer to keep PascalCase for interfaces:
interfaces/ → Contracts/
pages/locators/ → pages/Elements/
IDeleteCustomerPage.ts → DeleteCustomerPageContract.ts
IEditCustomerPage.ts → EditCustomerPageContract.ts
IHomePage.ts → HomePageContract.ts
ILoginPage.ts → LoginPageContract.ts
INewCustomerPage.ts → NewCustomerPageContract.ts
ITestUtil.ts → TestUtilContract.ts
DeleteCustomerPageLocators.ts → DeleteCustomerPageElements.ts
EditCustomerPageLocators.ts → EditCustomerPageElements.ts
HomePageLocators.ts → HomePageElements.ts
LoginPageLocators.ts → LoginPageElements.ts
NewCustomerPageLocators.ts → NewCustomerPageElements.ts
Why?
- ✅ Modern TypeScript conventions (no "I" prefix)
- ✅ Clear purpose with
.contract.tsand.elements.tssuffixes - ✅ Consistent with kebab-case folder naming already applied
- ✅ More concise and readable
- ✅ Industry standard (Angular, React, Vue projects)
cd Projects/Guru99BankTestAutomation
# Rename interfaces to contracts
mv interfaces contracts
# Rename locators to elements
mv pages/locators pages/elementscd contracts
mv IDeleteCustomerPage.ts deleteCustomer.contract.ts
mv IEditCustomerPage.ts editCustomer.contract.ts
mv IHomePage.ts home.contract.ts
mv ILoginPage.ts login.contract.ts
mv INewCustomerPage.ts newCustomer.contract.ts
mv ITestUtil.ts testUtil.contract.tscd ../pages/elements
mv DeleteCustomerPageLocators.ts deleteCustomer.elements.ts
mv EditCustomerPageLocators.ts editCustomer.elements.ts
mv HomePageLocators.ts home.elements.ts
mv LoginPageLocators.ts login.elements.ts
mv NewCustomerPageLocators.ts newCustomer.elements.tsNeed to update imports in:
- All page action files
- All test spec files
- Export barrel files
Keep interface/class names the same (ILoginPage, LoginPageElements) but update file paths.
npx tscgit add .
git commit -m "refactor: rename interfaces and locators for clarity
Folders:
- interfaces/ → contracts/
- pages/locators/ → pages/elements/
Interface files (modern TypeScript, no I prefix):
- ILoginPage.ts → login.contract.ts
- etc.
Locator files (clearer naming):
- LoginPageLocators.ts → login.elements.ts
- etc.
Benefits:
✅ Removes outdated 'I' prefix convention
✅ Clear .contract.ts and .elements.ts suffixes
✅ More concise and modern naming
✅ Follows TypeScript/Angular industry standards"For interfaces folder:
contracts/- My recommendationtypes/- Common in TypeScript projectsmodels/- If they represent data modelsprotocols/- Used in some projects
For locators folder:
elements/- My recommendation (most descriptive)selectors/- Common in test automationlocators/- Keep as-is (but not as clear)
For suffixes:
.contract.ts- Clear for interfaces.interface.ts- Alternative.type.ts- For TypeScript types.elements.ts- Clear for element definitions.selectors.ts- Alternative for locators