Skip to main content

Test Library for interfacing tests with Google Sheets API v4

Project description

GoogleSheetsLibrary

Version = 0.1.1a9
Library Scope: GLOBAL
Created: 12/20/2019 14:46 UTC-8

Author: Joshua Kim Rivera | email:joshua.rivera@mnltechnology.com

Company: Spiralworks Technologies Inc.

Contents:

Introduction

GoogleSheetsLibrary is a Robotframework Test Library for interfacing tests with Google Sheets using Google Sheets API v4.
PyPI PyPI - Downloads PyPI - Python Version

View the latest keyword Documentation here.

Installation

Option 1
Install using pypi, run:

pip install rf-googlesheetslibrary

Option 2
With recent version of pip, it is possible to install directly from GitHub repository. To Install latest source from the master branch, use this command:

pip install git+https://github.com/MainSystemDev/GoogleSheetsLibrary.git

Please note that installation will take some time, because pip will clone the GoogleSheetsLibrary project to a temporary directory and then perform the installation.

Usage

To use GoogleSheetsLibrary in Robot Framework tests, the library needs to first be imported using the Library setting as any other library.

*** Settings ***
Documentation                   Simple example using GoogleSheetsLibrary
Library                         GoogleSheetsLibrary
...                             scopes=['https://www.googleapis.com/auth/spreadsheets']
Library                         Collections

# Initialize the connection to the spreadsheet.
Suite Setup                     Initialize Spreadsheet
...                             spreadsheetId=sampleSpreadsheetId
...                             tokenFile=path/to/token.pickle

*** Variables ***
@{sample_range}                 Sheet!A1:E                  Sheet1!A1:E2

@{row_1}                        sample                      string
...                             written                     using
...                             googlesheets api v4
@{row_2}                        hello                       world
...                             i am                        using
...                             googlesheets api v4

@{values}                       ${row_1}                    ${row_2}

&{body}                         values=${values}

*** Test Cases ***
Sample Fetch Data
    [Documentation]             Fetch data from the initialized sheet.
    ${single_range_data}        Fetch Single Range          range_name=Sheet!A1:E1
    Log To Console              ${single_range_data}
    ${multiple_range_data}      Fetch Multiple Range        ranges=${sample_range}
    Log To Console              ${multiple_range_data}

Sample Write Data
    [Documentation]             Writes data to the initialized sheet.
    ${response}                 Write To Range              range_name=Sheet!A3:E4
    ...                         body=${body}
    Log To Console              ${response}

Sample Data Append
    [Documentation]             Append Data to the sheet.
    ${append_response}          Append Values               range_name=Sheet1
    ...                         body=${body}
    Log To Console              ${append_response}

Generating Documentation

To Generate the keyword Documentation, simple run:

python -m robot.libdoc GoogleSheetsLibrary documentation.html

Note that the library must first be installed before generating a documentation.

Dependencies

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

rf_googlesheetslibrary-0.1.1b4-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file rf_googlesheetslibrary-0.1.1b4-py3-none-any.whl.

File metadata

  • Download URL: rf_googlesheetslibrary-0.1.1b4-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

File hashes

Hashes for rf_googlesheetslibrary-0.1.1b4-py3-none-any.whl
Algorithm Hash digest
SHA256 a85e155173c365d32e10eccfd867b8fca30ad3cea4752c21d87ed130b7a06c05
MD5 6acf93ca738afbef7fa8918617b9d56b
BLAKE2b-256 0df12bf7363be09ba66b93576e27543f515ad4dcb52d3c03774b7bce2a8c8e2d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page