0% found this document useful (0 votes)
12 views13 pages

Uni 4 Script 4 CI

The document outlines a course on Software Testing and Automation, focusing on scripting and testing automation tools. Key topics include continuous integration practices, using GitHub for CI, and creating workflow files in YAML format for automated testing. Students will learn to implement various testing scripts and understand the applicability of different testing frameworks and tools.

Uploaded by

huntereye382
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views13 pages

Uni 4 Script 4 CI

The document outlines a course on Software Testing and Automation, focusing on scripting and testing automation tools. Key topics include continuous integration practices, using GitHub for CI, and creating workflow files in YAML format for automated testing. Students will learn to implement various testing scripts and understand the applicability of different testing frameworks and tools.

Uploaded by

huntereye382
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Unit 4: Testing automation tools and framework

Course Name- Software Testing and Automation


Course Code-COM-702(B)
Lecture No-

Topic – Scripting
Date- 11-11-2024

Model Institute of Engineering & Technology


Course Outcomes

By the end of the course, students shall be able to:

CO1 Understand the concepts of scripting and its importance

CO2 Analyze the variations in the types of testing suits and their applicability

CO3 Understand various testing tools for scripting

CO4 Understand what kind of testing carried out in different applications

CO5 Gain understanding of applicability of popular testing framework

Unit 4: Testing automation tools and framework


Recap

 Used Google Colab for Python based scripting


 Used browser stack for using browser’s functionality

 Used Heroku for exploring various testing elements

available online.
 Script List

1. To test the functionality of search box in google


2. To test the functionality of search box in Wikipedia
with assertion
3. To test user login authentication
4. Tested the working of add/remove buttons
New separate script:
5. Testing of downloading file
Unit 4: Testing automation tools and framework
Continuous Integration

 Continuous integration is a software development


practice where developers frequently merge their code
changes into a central repository, followed by
automated builds and tests.
 Purpose of CI:
• The primary goal of CI is to identify and address
conflicts and bugs early, improve software quality, and
reduce the time it takes to validate and release new
software updates.
 Common CI Tools:
• Git (GitHub, GitLab), Jenkins, Travis CI, CircleCI, and
TeamCity.
 Best Practices:
Unit 4: Testing automation tools and framework
• Commit code frequently.
GitHub for Continuous Integration

 Create a New Repository in GitHub


• Go to GitHub and click 'New Repository'.
• Name your repository and set visibility (public or private).
• Initialize with a README (optional), then create the
repository.
 Create a Workflow File in GitHub
• Navigate to your repository and click 'Actions'.
• Select a pre-configured workflow or create your own by
clicking 'set up a workflow yourself'.
• Define your workflow in a .yml file within the
.github/workflows directory.

Unit 4: Testing automation tools and framework


GitHub for Continuous Integration

 Configure Workflow
• Use the .yml file to define jobs, including setup, dependencies
installation, testing, and deployment.
 Wait for the .yml File to Execute
• Commit the .yml file to your repository.
• GitHub Actions automatically detects and executes new commits to
the .yml file, running the defined workflows.
 Committing Existing Notebook
• Add your notebook to the repository.
 Committing Colab Notebook
• Use Google Colab's GitHub integration to commit:
• Open the notebook in Colab, click on 'File', then 'Save a copy in GitHub'.
• Authorize Colab to access your GitHub account, select the repository,
specify the branch, and commit the notebook.
Unit 4: Testing automation tools and framework
GitHub for Continuous Integration

 Configure Workflow
• Use the .yml file to define jobs, including setup, dependencies
installation, testing, and deployment.
 Wait for the .yml File to Execute
• Commit the .yml file to your repository.
• GitHub Actions automatically detects and executes new commits to
the .yml file, running the defined workflows.
 Committing Existing Notebook
• Add your notebook to the repository.
 Committing Colab Notebook
• Use Google Colab's GitHub integration to commit:
• Open the notebook in Colab, click on 'File', then 'Save a copy in GitHub'.
• Authorize Colab to access your GitHub account, select the repository,
specify the branch, and commit the notebook.
Unit 4: Testing automation tools and framework
Sample to implement CI with github

 Step1: create repository, say testing.


 Step 2: create workflow file. Actions->New workflow->

set up a workflow yourself ->


Testing/.github/workflows/nameofymlfile.yml

 .yml file: A .yml file, which stands for YAML Ain't


Markup Language, is a human-readable data
serialization format. It is commonly used for
configuration files and in applications where data is
being stored or transmitted. YAML is designed to be
clear and easy to understand, making it a popular
choice for configuring software environments,
especially in the context of continuous integration and
deployment. Unit 4: Testing automation tools and framework
Sample to implement CI with github

 A workflow .yml file typically describes a set of


automated procedures that run one after another in a
defined sequence. This is especially common in
software development, where these workflows are used
for tasks such as testing, building, and deploying
software applications automatically. GitHub Actions
utilize .yml files to define the series of steps that the
platform should execute whenever a particular event
occurs in a repository, like pushing new code or
creating a pull request.

Unit 4: Testing automation tools and framework


Sample to implement CI with github

Sample .yml file


name: Selenium Tests
run: |
on: [push, pull_request] python -m pip install --
upgrade pip
jobs: pip install notebook
test: nbconvert ipykernel selenium
runs-on: ubuntu-latest
- name: Run Selenium Test
steps: env:
- uses: actions/checkout@v2 USERNAME: $
- name: Set up Python {{ secrets.BROWSERSTACK_US
uses: actions/setup- ERNAME }}
python@v2 ACCESS_KEY: $
with: {{ secrets.BROWSERSTACK_AC
python-version: '3.8’ CESS_KEY }}
- name: Install dependencies run: jupyter nbconvert --to
run: | notebook --execute --output
python -m pip install -- executed_notebook.ipynb
Unit 4: Testing automation tools and framework
upgrade pip TestDownloadCI.ipynb
pip install selenium
Create script notebook to integrate
with GitHub
 We will use a new script file that tests the downloading
files from Heroku platform.
 Follow the link to get the script code
https://colab.research.google.com/drive/17Q3_iG7ZcO9
5TJipgyTg45Z6G07h5-qf?usp=sharing
 Follow file-> save a copy in github- select repository-
main branch- commit message-enter
 Wait for script to run and integrate on GitHub

Unit 4: Testing automation tools and framework


Execution and version control

 Modify the script to add more downloading file testings


(or anyway of your choice) and then execute it
successfully before integrating with GitHub.
 Again save a copy in github, use a new commit
message.
 Wait for it to execute in github.
 Now Github has new and old versions of this script
files.

Unit 4: Testing automation tools and framework


Unit 4: Testing automation tools and framework

You might also like