npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

atlassian-test-base

v0.1.8

Published

A Testbase for the Attlessian cloud System

Downloads

37

Readme

Atlassian Test Base

The Atlassian Test Base is a test automation framework for Atlassian, which already includes basic functionalities for writing test programs.

Please start with Getting Started, Necessary Information and How to write tests to get a basic understanding.

You can find a commented example here


Getting Started

These instructions will get you set up to use atlassian-test-base in your project.

  1. install atlassian-test-base
npm install atlassian-test-base
  1. install cypress
npm install cypress --save-dev

Necessary Information

There are some information which are required when using this testbase. The following paragraph shows you how to obtain these information.

  1. Basic URL of your Atlassian-website
 https://example.atlassian.net
  1. An API token of your user profile
    • log in to https://id.atlassian.com/manage-profile/security/api-tokens
    • click Create API token
    • from the dialog that appears, enter a memorable and concise Label for your token and click Create.
    • click Copy to clipboard, then paste the token to your script or make sure to save it somewhere else
  2. Account ID of the website owner
    • go on your Atlassian webside
    • click on Teams
    • click on Search for people and teams
    • click on the person who owns the website
    • now the URL should have this format:
    JIRA:         https://example.atlassian.net/jira/people/AccountID 
    Confluence:   https://example.atlassian.net/wiki/people/AccountID
    • copy and save the ID

How to write tests

The following paragraph shows you how to implement your testcases using the test base.

  1. The first and last lines of your code will always be the same.
    1. You have to import the testbase. This should be the first line.

      import {Testbase} from "atlassian-test-base";
    2. In your second line, you need to initialize the testbase. The Atlassian URL and your API token is required here.

      let testbase = new Testbase("yourWebsiteURL", "API token")
    3. The last line always executes the testbase:

      testbase.executeTestcases("all")

      In this example we execute "all" testcases we have.

In summary, the basic format should look like this:

  import {Testbase} from 'atlassian-test-base';
  let testbase = new Testbase("yourWebsiteURL", "API token");

   // Here you will leter implement your Testcases

  testbase.executeTestcases("all")
  1. Create your test cases. In this testbase, test cases are structured as a collection of different teststeps.

    1. First of all, you need to create a new, empty testcase with a name and a description:
      testbase.createTestcase("testcase name", "description");
    2. Now you can add different teststeps to the created testcase. To keep it simple, we will only use the already implemented teststep to create a Jira-Project. (you can find a list of all implemented teststeps in All functionalities). You add the teststep with the following line:
      testbase.addTeststep("testcase name", testbase.jira.Project().Create(parameter))
  2. Now, when you put it all together, your code should look like this:

    import {Testbase} from 'atlassian-test-base';
    let testbase = new Testbase("yourWebsiteURL", "API token");
      
    testbase.createTestcase("testcase name", "description");
    testbase.addTeststep("testcase name", testbase.jira.Project().Create(parameter))
    
    testbase.executeTestcases("all")

    You can find a working example here.


All functionalities

Testcases

Each testcase consists of several teststeps. It can also be assigned to categories to sort and seperate many different testcases.

create a testcase

testbase.createTestcase("Test1","my first test", "example")

This function creates a new testcase with the name Test1, the description my first test and the category example. Node: A test case can have an infinite number of categories

add teststeps to your testcase

testbase.addTeststep("Test1", testbase.jira.Project().create(parameter))

This function adds the teststep to Test1 which creates a Jira project.

addbefore

testbase.addBefore("Test1", testbase.jira.Project().create(parameter))

This function adds a teststep which is executed before the specific testcase. It is not included in the report.

addbeforeEach

testbase.addBeforeEach(testbase.jira.Project().create(parameter))

This function adds a teststep which is executed before every testcase. It is not included in the report.

addAfter

testbase.addAfter("Test1", testbase.jira.Project().create(parameter))

This function adds a teststep which is executed after the specific testcase. It is not included in the report.

addAfterEach

testbase.addAfterEach(testbase.jira.Project().create(parameter))

This function adds a teststep which is executed after every testcase. It is not included in the report.

Teststeps

There are 3 types of already implemented teststeps. The Jira,Confluence and SessionHandler teststep. Each of them has its own subordinate functionalities and can be called seperately. For example, if you want to get the teststep which creates a new Jira project you need to type the following line:

testbase.jira.Project().create(parameter)

Note: "parameter" represents the parameter which are necessary for a Jira projekt. You can read about the Jira-parameter here and about the Confluence-Parameter here

| functionality | subordinate functionality | |----------------|------------------------------------------------------| | Jira | Project IssueFieldvalue | | Confluence | Blog Post Page Space Object Attribute | | SessionHandler | login SaveSession |

Each subordinate functionality of Jira and Confluence implements the CRUD functionalities (create, read, update and delete)

Custom teststeps

This software is designed to work with Cypress and offers the ability to implement your own custom Cypress specs. You can find a tutorial for Cypress here. If you have written your specs, add them with the special teststep cypress() which is made for running cypress specs

testbase.addTeststep("Test1", testbase.cypress("path/to/your/spec.ts"))

In this example we are adding spec.ts as a teststep to Test1.


Execution of test cases

testbase.executeTestcases("example")

This function executes every testcase which has the category example. After the execution, a report will be created automatically.


Test report

After each execution, a report is created and can be found in in reports. Each testbase will only have one corresponding report file. The report for the first execution will be called "TestResult--1", the report for the second execution "TestResult--2" and so on. This also works with report files with custom names. Furthermore, it is possible to create multiple reports with the same name for independent testbases in one programm. In this case, the report names from the second report on will be specified as "TestResult-(number of copies)". All reports are created automatically and have a special xml-Format, so you can import them with Jira-Cloud-Xray. Note: Old report files will not be overwritten.

Changing the report file target path

testbase.changeXMLReportDestination("/.../filename.xml")

If you want to change the folder where the reports are saved in, you can use this method and declare the new path. The xml suffix is not needed and will be added automatically if it has not been included.

Additional information

  • further explanation for the teststep parameter is coming soon. For now, please use the explanation linked in Teststeps