Implement automated smoke testing utilizing Amazon Nova Act headless mode
Automated smoke testing utilizing Amazon Nova Act headless mode helps improvement groups validate core performance in steady integration and steady supply (CI/CD) pipelines. Growth groups typically deploy code a number of instances every day, so quick testing helps preserve utility high quality. Conventional end-to-end testing can take hours to finish, creating delays in your CI/CD pipeline.
Smoke testing is a subset of testing that validates essentially the most crucial features of an utility work accurately after deployment. These exams deal with key workflows like consumer login, core navigation, and key transactions relatively than exhaustive characteristic protection. Smoke exams usually full in minutes relatively than hours, making them ideally suited for CI/CD pipelines the place quick suggestions on code adjustments is important.
Amazon Nova Act makes use of AI-powered UI understanding and pure language processing to work together with internet purposes, changing conventional CSS selectors. As a substitute of sustaining brittle CSS selectors and complicated take a look at scripts, you may write exams utilizing easy English instructions that adapt to UI adjustments.
This publish reveals tips on how to implement automated smoke testing utilizing Amazon Nova Act headless mode in CI/CD pipelines. We use SauceDemo, a pattern ecommerce utility, as our goal for demonstration. We exhibit establishing Amazon Nova Act for headless browser automation in CI/CD environments and creating smoke exams that validate key consumer workflows. We then present tips on how to implement parallel execution to maximise testing effectivity, configure GitLab CI/CD for automated take a look at execution on each deployment, and apply greatest practices for maintainable and scalable take a look at automation.
Resolution overview
The answer features a Python take a look at runner that executes smoke exams, ecommerce workflow validation for full consumer journeys, GitLab CI/CD integration for automation, and parallel execution to hurry up testing. Headless mode runs browser exams within the background with out opening a browser window, which works effectively for automated testing.
The next diagram illustrates the testing workflow.
We stroll by way of the next steps to implement automated smoke testing with Amazon Nova Act:
- Arrange your challenge and dependencies.
- Create a smoke take a look at with login validation.
- Configure validation for the whole ecommerce workflow.
- Configure the automated testing pipeline.
- Configure parallel execution.
Stipulations
To finish this walkthrough, you need to have the next:
Arrange challenge and dependencies
Create your challenge and set up dependencies:
Create a take a look at runner
Create smoke_tests.py:
Take a look at your setup with the next instructions:
Surroundings variables like NOVA_ACT_API_KEY preserve delicate info safe and separate out of your code.
This resolution implements the next security measures:
- Shops API keys in atmosphere variables or .env information (add
.envto .gitignore) - Makes use of totally different API keys for improvement, staging, and manufacturing environments
- Implements key rotation each 90 days utilizing automated scripts or calendar reminders
- Screens API key utilization by way of logs to detect unauthorized entry
You now have a contemporary Python challenge with Amazon Nova Act configured and prepared for testing. Subsequent, we present tips on how to create a working smoke take a look at that makes use of pure language browser automation.
Create smoke take a look at for login validation
Let’s broaden your basis code to incorporate an entire login take a look at with correct construction.
Add foremost perform and login take a look at
Replace smoke_tests.py:
Take a look at your login circulation
Run your full login take a look at:
You need to see the next output:
Your smoke take a look at now validates an entire consumer journey that makes use of pure language with Amazon Nova Act. The take a look at handles web page verification to verify you’re on the login web page, kind interactions that enter consumer identify and password credentials, motion execution that clicks the login button, and success validation that verifies the merchandise web page hundreds accurately. The built-in error dealing with gives retry logic if the login course of encounters any points, exhibiting how the AI-powered automation of Amazon Nova Act adapts to dynamic internet purposes with out the brittleness of conventional CSS selector-based testing frameworks.
Though a login take a look at gives useful validation, real-world purposes require testing full consumer workflows that span a number of pages and complicated interactions. Subsequent, we broaden the testing capabilities by constructing a complete ecommerce journey that validates the whole buyer expertise.
Configure ecommerce workflow validation
Let’s construct a complete ecommerce workflow that exams the end-to-end buyer journey from login to logout.
Add full ecommerce take a look at
Replace smoke_tests.py to incorporate the complete workflow:
Take a look at your ecommerce workflow
Run your complete take a look at suite:
You need to see the next output:
Understanding the ecommerce journey
The workflow exams an entire buyer expertise:
- Authentication – Login with legitimate credentials
- Product discovery – Browse and choose merchandise
- Buying cart – Add objects and confirm cart contents
- Checkout course of – Enter delivery info
- Order completion – Full buy and confirm success
- Navigation – Return to merchandise and sign off
The next screenshot reveals the step-by-step visible information of the consumer journey.
Your smoke exams now validate full consumer journeys that mirror actual buyer experiences. The ecommerce workflow reveals how Amazon Nova Act handles complicated, multi-step processes throughout a number of pages. By testing the whole buyer journey from authentication by way of order completion, you’re validating the first revenue-generating workflows in your utility.
This strategy reduces upkeep overhead whereas offering complete protection of your utility’s core performance.
Operating these exams manually gives speedy worth, however the actual energy comes from integrating them into your improvement workflow. Automating take a look at execution makes positive code adjustments are validated towards your crucial consumer journeys earlier than reaching manufacturing.
Configure automated testing pipeline
Together with your complete ecommerce workflow in place, you’re able to combine these exams into your CI pipeline. This step reveals tips on how to configure GitLab CI/CD to mechanically run these smoke exams on each code change, ensuring key consumer journeys stay purposeful all through your improvement cycle. We present tips on how to configure headless mode for CI environments whereas sustaining the visible debugging capabilities for native improvement.
Add headless mode for CI/CD
Replace smoke_tests.py to help headless mode for CI environments by including the next strains to each take a look at features:
Create GitHub Actions workflow
GitLab CI/CD is GitLab’s built-in CI system that mechanically runs pipelines when code adjustments happen. Pipelines are outlined in YAML information that specify when to run exams and what steps to execute.
Create .gitlab-ci.yml:
Configure GitLab CI/CD variables
GitLab CI/CD variables present safe storage for delicate info like API keys. These values are encrypted and solely accessible to your GitLab CI/CD pipelines. Full the next steps so as to add a variable:
- In your challenge, select Settings, CI/CD, and Variables.
- Select Add variable.
- For the important thing, enter
NOVA_ACT_API_KEY. - For the worth, enter your Amazon Nova Act API key.
- Choose Masks variable to cover the worth in job logs.
- Select Add variable.
Understanding the code adjustments
The important thing change is the headless mode configuration:
This configuration gives flexibility for various improvement environments. Throughout native improvement when the HEADLESS atmosphere variable isn’t set, the headless parameter defaults to False, which opens a browser window so you may see the automation in motion. This visible suggestions is invaluable for debugging take a look at failures and understanding how Amazon Nova Act interacts together with your utility. In CI/CD environments the place HEADLESS is ready to true, the browser runs within the background with out opening any home windows, making it ideally suited for automated testing pipelines that don’t have show capabilities and have to run effectively with out visible overhead.
Take a look at your CI/CD setup
Push your code to set off the workflow:
Verify the Pipelines part in your GitLab challenge to see the exams operating.
Your smoke exams now run mechanically as a part of your CI pipeline, offering speedy suggestions on code adjustments. The GitLab CI/CD integration makes positive crucial consumer journeys are validated earlier than any deployment reaches manufacturing, lowering the chance of delivery damaged performance to prospects.
The implementation reveals how fashionable bundle administration with UV reduces CI/CD pipeline execution time in comparison with conventional pip installations. Mixed with safe API key administration by way of GitLab CI/CD variables, your testing infrastructure follows enterprise safety greatest practices.
As your take a look at suite grows, you may discover that operating exams sequentially can grow to be a bottleneck in your deployment pipeline. The subsequent part addresses this problem by implementing parallel execution to maximise your CI/CD effectivity.
Configure parallel execution
Together with your CI/CD pipeline efficiently validating particular person take a look at instances, the subsequent optimization focuses on efficiency enhancement by way of parallel execution. Concurrent take a look at execution can scale back your complete testing time by operating a number of browser situations concurrently, maximizing the effectivity of your CI/CD assets whereas sustaining take a look at reliability and isolation.
Add parallel execution framework
Replace smoke_tests.py to help concurrent testing:
Replace GitLab CI/CD for parallel execution
The parallel execution is already configured in your .gitlab-ci.yml with the MAX_WORKERS= "2" variable. The pipeline mechanically makes use of the parallel framework when operating the smoke exams.
Take a look at parallel execution
Run your optimized exams:
You need to see each exams operating concurrently:
Understanding parallel execution
ThreadPoolExecutor is a Python class that manages a pool of employee threads, permitting a number of duties to run concurrently. On this case, every thread runs a separate browser take a look at, lowering complete execution time.
Parallel execution gives advantages reminiscent of quicker execution (as a result of exams run concurrently as a substitute of sequentially), configurable employees that regulate primarily based on system assets, useful resource effectivity that optimizes CI/CD compute time, and scalability that makes it easy so as to add extra exams with out rising complete runtime.
Nonetheless, there are essential issues to remember. Every take a look at opens a browser occasion (which will increase useful resource utilization), exams have to be impartial of one another to take care of correct isolation, and you need to stability employee counts with accessible CPU and reminiscence limits in CI environments.
Every parallel take a look at makes use of system assets and incurs API utilization. Begin with two employees and regulate primarily based in your atmosphere’s capability and price necessities. Monitor your Amazon Nova Act utilization to optimize the stability between take a look at pace and bills.
The efficiency enchancment is important when evaluating sequential vs. parallel execution. In sequential execution, exams run one after one other with the entire time being the sum of all particular person take a look at durations. With parallel execution, a number of exams run concurrently, finishing in roughly the time of the longest take a look at, leading to substantial time financial savings that grow to be extra useful as your take a look at suite grows.
Your smoke exams now characteristic concurrent execution that considerably reduces complete testing time whereas sustaining full take a look at isolation and reliability. The ThreadPoolExecutor implementation permits a number of browser situations to run concurrently, reworking your sequential take a look at suite right into a parallel execution that completes a lot quicker. This efficiency enchancment turns into more and more useful as your take a look at suite grows, so complete validation doesn’t grow to be a bottleneck in your deployment pipeline.
The configurable employee rely by way of the MAX_WORKERS atmosphere variable gives flexibility to optimize efficiency primarily based on accessible system assets. In CI/CD environments, this lets you stability take a look at execution pace with useful resource constraints, and native improvement can use full system capabilities for quicker suggestions cycles. The structure maintains full take a look at independence, ensuring parallel execution doesn’t introduce flakiness or cross-test dependencies that would compromise reliability. As a greatest observe, preserve exams impartial—every take a look at ought to work accurately no matter execution order or different exams operating concurrently.
Finest practices
Together with your performance-optimized testing framework full, think about the next practices for manufacturing readiness:
- Preserve exams impartial. Assessments should not impacted by execution order or different exams operating concurrently.
- Add retry logic by wrapping your take a look at features in try-catch blocks with a retry mechanism for dealing with transient community points.
- Configure your GitLab CI/CD pipeline with an inexpensive timeout and think about including a scheduled run for every day validation of your manufacturing atmosphere.
- For ongoing upkeep, set up a rotation schedule to your Amazon Nova Act API keys and monitor your take a look at execution instances to catch efficiency regressions early. As your utility grows, you may add new take a look at features to the parallel execution framework with out impacting general runtime, making this resolution extremely scalable for future wants.
Clear up
To keep away from incurring future fees and preserve safety, clear up the assets you created:
- Take away or disable unused GitLab CI/CD pipelines
- Rotate API keys each 90 days and revoke unused keys.
- Delete the repositories supplied with this publish.
- Take away API keys from inactive initiatives.
- Clear cached credentials and non permanent information out of your native atmosphere.
Conclusion
On this publish, we confirmed tips on how to implement automated smoke testing utilizing Amazon Nova Act headless mode for CI/CD pipelines. We demonstrated tips on how to create complete ecommerce workflow exams that validate consumer journeys, implement parallel execution for quicker take a look at completion, and combine automated testing with GitLab CI/CD for steady validation.
The pure language strategy utilizing Amazon Nova Act wants much less upkeep than conventional frameworks that use CSS selectors. Mixed with fashionable tooling like UV bundle administration and GitLab CI/CD, this resolution gives quick, dependable take a look at execution that scales together with your improvement workflow. Your implementation now catches points earlier than they attain manufacturing, offering the quick suggestions important for assured steady deployment whereas sustaining excessive utility high quality requirements.
To be taught extra about browser automation and testing methods on AWS, discover the next assets:
Attempt implementing these smoke exams in your individual purposes and think about extending the framework with further take a look at eventualities that match your particular consumer journeys. Share your expertise and any optimizations you uncover within the feedback part.
In regards to the authors
Sakthi Chellapparimanam Sakthivel is a Options Architect at AWS, specializing in .NET modernization and enterprise cloud transformations. He helps GSI and software program/providers prospects construct scalable, revolutionary options on AWS. He architects clever automation frameworks and GenAI-powered purposes that drive measurable enterprise outcomes throughout numerous industries. Past his technical pursuits, Sakthivel enjoys spending high quality time together with his household and taking part in cricket.
Shyam Soundar is a Options Architect at AWS with an in depth background in safety, cost-optimization, and analytics choices. Shyam works with enterprise prospects to assist them construct and scale purposes to attain their enterprise outcomes with decrease price.
Reena M is an FSI Options Architect at AWS, specializing in analytics and generative AI-based workloads, serving to capital markets and banking prospects create safe, scalable, and environment friendly options on AWS. She architects cutting-edge knowledge platforms and AI-powered purposes that rework how monetary establishments leverage cloud applied sciences. Past her technical pursuits, Reena can be a author and enjoys spending time together with her household.


