Skip to content

Hypersequent/qasphere-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qasphere-csv

The qasphere-csv Go library simplifies the creation of CSV files for importing test cases into the QA Sphere Test Management System.

What is QA Sphere?
QA Sphere is a Test Management System designed to help teams organize their QA process without the clutter of overly complex tools. It provides everything you need to manage test cases, schedule runs, and keep track of your progress. With features like AI-powered test case creation and automation integrations, QA Sphere focuses on making your QA workflows efficient and straightforward.

Library Features

  • Programmatically create large projects instead of manual entries.
  • Facilitate migration from older test management systems by converting exported data into QA Sphere's CSV format.
  • Includes in-built validations to ensure CSV files meet QA Sphere's requirements for smooth import.

How to Use

Starting from Scratch

Clone the repository and explore the basic example. Modify the code to add your test cases and run:

go run examples/basic/main.go

Use the WriteCSVToFile() method to write directly to a file.

Integrating into an Existing Project

To include qasphere-csv in your Go project, run:

go get github.com/hypersequent/qasphere-csv

Import the library in your Go project:

import qascsv "github.com/hypersequent/qasphere-csv"

Refer to the basic example for API usage.

Importing Test Cases on QA Sphere

  1. Create a new Project, if not already done.
  2. Open the project from the Dashboard and navigate to the Test Cases tab.
  3. Select the Import option from the dropdown in the top right.

For more details, please check the documentation.

Custom Fields

Custom fields must be declared with AddCustomField/AddCustomFields before adding test cases that use them. Three types are supported:

  • text — plain text, no length limit.
  • dropdown — the value must match one of the options defined for the field in QA Sphere (option values are limited to 255 characters).
  • richtext — rich text, no length limit. Values are HTML (e.g. <p>…</p>, <pre><code>…</code></pre>), unlike Preconditions and Steps, which take markdown. QA Sphere sanitizes the HTML on import using an allowlist of tags and attributes.

For example, to populate QA Sphere's rich text Description field:

qasCSV := qascsv.NewQASphereCSV()
_ = qasCSV.AddCustomField(qascsv.CustomField{
	SystemName: "description",
	Type:       qascsv.CustomFieldTypeRichtext,
})
_ = qasCSV.AddTestCase(qascsv.TestCase{
	Title:      "Login with valid credentials",
	FolderPath: []string{"Auth"},
	Priority:   qascsv.PriorityHigh,
	CustomFields: map[string]qascsv.CustomFieldValue{
		"description": {Value: "<p>Verifies the standard login flow.</p>"},
	},
})

This produces a custom_field_richtext_description column matching QA Sphere's CSV export format.

Contributing

We welcome contributions! If you have a feature request, encounter a problem, or have questions, please create a new issue. You can also contribute by opening a pull request.

Before submitting a pull request, please ensure:

  1. Appropriate unit tests are added and existing tests pass - make test
  2. Lint checks pass - make lint

License

This library is available under the MIT License. For more details, please see the LICENSE file.

About

Library to write QA Sphere CSV files with test cases

Topics

Resources

License

Stars

8 stars

Watchers

0 watching

Forks

Contributors