Code Monkey home page Code Monkey logo

testzeus's Introduction

⚑Automation for Salesforce is tough (no , seriously). And every platform release brings the lightning and thunder for UI Automation tests (Winter21 caused even our tests to shiver). So we thought, what if we could find a solution to this madness and create a simple (but robust) framework for Salesforce automation tests. And solve the problem of flaky tests, while accelerating the development of automation tests.

Presenting (drum roll πŸ₯) TestZeus -> An open source automation framework built specifically for Salesforce. So what ? Well, this framework has boiler plate code to get you started with test automation for your Salesforce org. And just to name a few features :

The core of the framework works on top of Salesforce's UI API to achieve UI automation. Dont know what is UI API? No worries at all , here is a resource to get you going : https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_get_started.htm

And here is a nice diagram from our friends at Salesforce:

uiAPiimage

AutoLocator Strategy πŸ€–:

This is where the magic happens. We parse the UI API and process the jsonresponse for labels, datatypes and sections to create the actions and locators for the UI elements on the fly. Ask me how? See this now : AutoLocators drawio

High Level Framework diagram πŸ›:

Here is a high level diagram for the framework. The tests can be run from maven or TestNG.

TestZeusArchitecture drawio

Podcast around TestZeus : https://youtu.be/iQk0cZuR-ko

Pre-requisites πŸ”—:

  • Technical requirements : JAVA, Maven, TestNG, ChromeDriver on the local.
  • And Non-technical requirements : A beverage of your choice (coffee/tea) and some good music to automate the toughest of test cases.

Instructions to runπŸƒβ€β™‚οΈ:

  • Option 1 - Both the UI and API test can be run as standalone TESTNG tests OR
  • Option 2- Perform a maven build with (clean install test) goals on the pom.xml

Note: The demo test cases under src\test\java\com\AT\testscripts require credentials from config.json file for authentication and authorization, so dont forget to put in the credentials before trying to run the tests .

Creating UI Test cases βœ’:

As easy as 1-2-3:

  1. Add the Page object class for which the flow has to be modeled
  2. The class variable for the same needs to be added to the BaseTest class for instantiation
  3. Create the actual test class with references to the web elements and corresponding actions from the page object class

Each test class is extended from BaseTest, thereby inheriting the wrapped methods for @BeforeClass and @BeforeSuite.

BaseTest class also triggers the below 2 things:

  • Page Object Model: The page objects are instantiated at run time via Reflection
  • Data setup and post execution clean up of webdriver

Wrapper methods for abstracting the webdriver internals are written in the PageBase class. Methods to interact with UI API and create locators/interactions are setup in the SFPageBase class.

Debug tests 🐜:

Detailed option: Run as -Dtest=SmokeTest -Dmaven.surefire.debug test And then: Debug config->set up 5005 port and then continue debugging

Quick Option: As always, adding break points and debug as TestNG test

Video Demo

Under 5 minute video to show you the highlights of the framework and a demo of the execution :

TestZeusDemocompressed.mp4

Why is the name TestZeus?

Zeus is the God of lightning and thunder and we want this framework to be the same with Lightning platform. (plus we got the domain name for a cheap price πŸ€—)

Summary πŸ™

  • Stop writing flaky locators and cryptic xpaths for Webelements on the Salesforce UI. We source the locator values for your scripts from the Salesforce UI API , so that you can focus more on building tests and less on maintenance
  • The world of testing for Salesforce can be fast-paced and scary. That's why we are together in this mission and need your help to spread the word, try the framework or contribute to our codebase. And we have a long road ahead of us, so lets join forces to automate Salesforce

Support ☎

You can find a happy and helping community of Test Automation/QA folks at the below link:

https://trailhead.salesforce.com/en/trailblazer-community/groups/0F93A000000DQPdSAO?sort=LAST_MODIFIED_DATE_DESC&tab=discussion#

And if you would like to technically contribute/raise an issue, then feel free to open a ticket on this Github Repo.

Note : We are in no way directly or indirectly associated with Salesforce (yet).

Made with β™₯ in India.

testzeusanimated

Buy Me A Coffee

testzeus's People

Contributors

smilinrobin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.