Class: EasyqaApi::TestPlan

Inherits:
Item
  • Object
show all
Defined in:
lib/easyqa_api/items/test_plan.rb

Overview

Test plan representation from EasyQA website

Constant Summary

Constants inherited from Item

Item::CONNECTION

Constants included from ClassMethodsSettable

ClassMethodsSettable::METHODS

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Item

#initialize, #install_variables!, json_connection, multipart_connection, operation_status, send_request

Methods included from ClassMethodsSettable

#install_class_methods!

Constructor Details

This class inherits a constructor from EasyqaApi::Item

Instance Attribute Details

#attributesHash

Returns item attributes from response body in your requests.

Returns:

  • (Hash)

    item attributes from response body in your requests



16
# File 'lib/easyqa_api/items/test_plan.rb', line 16

attr_accessor :title, :id, :attributes, :project_token

#idFixnum

Returns The uniq identeficator item on EasyQA website.

Returns:

  • (Fixnum)

    The uniq identeficator item on EasyQA website



16
# File 'lib/easyqa_api/items/test_plan.rb', line 16

attr_accessor :title, :id, :attributes, :project_token

#project_tokenString

Returns your project token.

Returns:

  • (String)

    your project token



16
# File 'lib/easyqa_api/items/test_plan.rb', line 16

attr_accessor :title, :id, :attributes, :project_token

#titleString

Returns Test plan title on EasyQA.

Returns:

  • (String)

    Test plan title on EasyQA



16
17
18
# File 'lib/easyqa_api/items/test_plan.rb', line 16

def title
  @title
end

Class Method Details

.all(project_token, user = @@default_user) ⇒ Array

List of all test plans in project

Parameters:

  • user (Easyqapi::User) (defaults to: @@default_user)

    authenticated user in EasyQA

  • project_token (String)

    token of project

Returns:

  • (Array)

    list of test plans on EasyQA website

See Also:



25
26
27
28
29
30
31
32
# File 'lib/easyqa_api/items/test_plan.rb', line 25

def self.all(project_token, user = @@default_user)
  send_request('test_plans', :get) do |req|
    req.params = {
      auth_token: user.auth_token,
      token: project_token
    }
  end
end

Instance Method Details

#create(attrs, user = @@default_user) ⇒ Hash

Create test plan on EasyQA website. Have a class method analog

Parameters:

  • user (Easyqapi::User) (defaults to: @@default_user)

    authenticated user in EasyQA

  • attrs (Hash)

    attributes for action

Options Hash (attrs):

  • :project_token (String) — default: @project_token

    Project token on EasyQA

  • :title (String)

    test plan title on EasyQA website

  • :description (String)

    test case pre steps

Returns:

  • (Hash)

    item attribtues on EasyQA website

See Also:



36
37
38
39
40
41
42
43
44
45
# File 'lib/easyqa_api/items/test_plan.rb', line 36

def create(attrs, user = @@default_user)
  attrs = { project_token: @project_token }.merge(attrs)
  @attributes = send_request('test_plans', :post) do |req|
    req.body = {
      test_plan: attrs.except(:project_token),
      token: attrs[:project_token],
      auth_token: user.auth_token
    }
  end
end

#delete(project_token = @project_token, id = @id, user = @@default_user) ⇒ Hash

Delete test plan on EasyQA website. Have a class method analog

Parameters:

  • user (Easyqapi::User) (defaults to: @@default_user)

    authenticated user in EasyQA

  • project_token (String) (defaults to: @project_token)

    token of project

  • id (String) (defaults to: @id)

    item id

Returns:

  • (Hash)

    item attribtues on EasyQA website

See Also:



74
75
76
77
78
79
80
81
# File 'lib/easyqa_api/items/test_plan.rb', line 74

def delete(project_token = @project_token, id = @id, user = @@default_user)
  @attributes = send_request("test_plans/#{id}", :delete) do |req|
    req.body = {
      token: project_token,
      auth_token: user.auth_token
    }
  end
end

#show(project_token = @project_token, id = @id, user = @@default_user) ⇒ Hash

Show test plan from EasyQA website. Have a class method analog

Parameters:

  • user (Easyqapi::User) (defaults to: @@default_user)

    authenticated user in EasyQA

  • project_token (String) (defaults to: @project_token)

    token of project

  • id (String) (defaults to: @id)

    item id

Returns:

  • (Hash)

    item attribtues on EasyQA website

See Also:



49
50
51
52
53
54
55
56
# File 'lib/easyqa_api/items/test_plan.rb', line 49

def show(project_token = @project_token, id = @id, user = @@default_user)
  @attributes = send_request("test_plans/#{id}", :get) do |req|
    req.params = {
      token: project_token,
      auth_token: user.auth_token
    }
  end
end

#update(attrs, user = @@default_user) ⇒ Hash

Update test plan on EasyQA website. Have a class method analog

Parameters:

  • user (Easyqapi::User) (defaults to: @@default_user)

    authenticated user in EasyQA

  • attrs (Hash)

    attributes for action

Options Hash (attrs):

  • :project_token (String) — default: @project_token

    Project token on EasyQA

  • :title (String)

    test plan title on EasyQA website

  • :description (String)

    test case pre steps

  • :id (Fixnum) — default: @id

    test plan id on EasyQA website

Returns:

  • (Hash)

    item attribtues on EasyQA website

See Also:



61
62
63
64
65
66
67
68
69
70
# File 'lib/easyqa_api/items/test_plan.rb', line 61

def update(attrs, user = @@default_user)
  attrs = { id: @id, project_token: @project_token }.merge(attrs)
  @attributes = send_request("test_plans/#{attrs[:id]}", :put) do |req|
    req.body = {
      test_plan: attrs.except(:project_token, :id),
      token: attrs[:project_token],
      auth_token: user.auth_token
    }
  end
end