Project

lolitado

0.0
No commit activity in last 3 years
No release in over 3 years
Lolitado DSL that works with Watir
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.14
~> 5.49.0
 Project Readme

lolitado

Library for using database and API


How to call database?

You need to do these things:

  • put all sql in sql.yml or in code
  • put database connect info in xx_db.yml

run case like

pool = Lolitado:Pool.new('xx_db.yml')
db = pool.use(:db =>'db_name')
sql = "select * from identity.user where phone = '+86 139 0000 0000"
result = db.query(sql)

How to call API?


run case like

 * Rest API
  class TestRest
    include Lolitado

    def initialize
      base_uri 'https://xxx.com'
    end

    def get_details_of_a_city city_slug, locale
      add_headers({'Accept-Language' => locale})
      request('get', "/cities/#{city_slug}")
    end
  end

* Graph API
  class TestGraph
    include Lolitado

    def initialize
      base_uri 'https://xxx.com'
    end

    def user_login payload
      add_headers({'Content-Type' => "application/json"})
      query = "mutation login($input: UserLoginInput!) {userLogin(input:$input) {authToken}}"
      graph_request(query, payload)
    end
  end

How to encrypt/decrypt credential file?

  • Initialize Box with secret key of environment variable
  • file_encrypt to encrypt the file
  • file_decrypt to decrypt the file

box = Lolitado:Box.new('ENV_KEY')
box.file_encrypt('file_name')
box.file_decrypt('encrypt_file_name')