productivitycuj

package
v0.0.0-...-683b059 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Overview

Package productivitycuj contains productivity CUJ test cases library.

Index

Constants

View Source
const (
	// MicrosoftWeb indicates testing against Microsoft Web.
	MicrosoftWeb = "MicrosoftWeb"
	// GoogleWeb indicates testing against Google Web.
	GoogleWeb = "GoogleWeb"
)

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cr *chrome.Chrome, app ProductivityApp, tier cuj.Tier, tabletMode bool, outDir, sampleSheetURL, expectedText, testFileLocation string) (err error)

Run runs the specified user scenario in productivity with different CUJ tiers.

Types

type GoogleDocs

type GoogleDocs struct {
	// contains filtered or unexported fields
}

GoogleDocs implements the ProductivityApp interface.

func NewGoogleDocs

func NewGoogleDocs(cr *chrome.Chrome, tconn *chrome.TestConn, kb *input.KeyboardEventWriter, uiHdl cuj.UIActionHandler) *GoogleDocs

NewGoogleDocs creates GoogleDocs instance which implements ProductivityApp interface.

func (*GoogleDocs) Cleanup

func (app *GoogleDocs) Cleanup(ctx context.Context, sheetName string) error

Cleanup cleans up the resources used by running the GDocs testing. It removes the document and slide which we created in the test case and close all tabs after completing the test. This function should be called as deferred function after the app is created.

func (*GoogleDocs) CreateDocument

func (app *GoogleDocs) CreateDocument(ctx context.Context) error

CreateDocument creates a new document from GDocs.

func (*GoogleDocs) CreateSlides

func (app *GoogleDocs) CreateSlides(ctx context.Context) error

CreateSlides creates a new presentation from GDocs.

func (*GoogleDocs) CreateSpreadsheet

func (app *GoogleDocs) CreateSpreadsheet(ctx context.Context, sampleSheetURL string) (string, error)

CreateSpreadsheet creates a new spreadsheet by copying from sample spreadsheet.

func (*GoogleDocs) MoveDataFromDocToSheet

func (app *GoogleDocs) MoveDataFromDocToSheet(ctx context.Context) error

MoveDataFromDocToSheet moves data from document to spreadsheet.

func (*GoogleDocs) MoveDataFromSheetToDoc

func (app *GoogleDocs) MoveDataFromSheetToDoc(ctx context.Context) error

MoveDataFromSheetToDoc moves data from spreadsheet to document.

func (*GoogleDocs) OpenSpreadsheet

func (app *GoogleDocs) OpenSpreadsheet(ctx context.Context, filename string) error

OpenSpreadsheet creates a new document from GDocs.

func (*GoogleDocs) ScrollPage

func (app *GoogleDocs) ScrollPage(ctx context.Context) error

ScrollPage scrolls the document and spreadsheet.

func (*GoogleDocs) SwitchToOfflineMode

func (app *GoogleDocs) SwitchToOfflineMode(ctx context.Context) error

SwitchToOfflineMode switches to offline mode.

func (*GoogleDocs) UpdateCells

func (app *GoogleDocs) UpdateCells(ctx context.Context) error

UpdateCells updates one of the independent cells and propagate values to dependent cells.

func (*GoogleDocs) VoiceToTextTesting

func (app *GoogleDocs) VoiceToTextTesting(ctx context.Context, expectedText string, playAudio action.Action) error

VoiceToTextTesting uses the "Dictate" function to achieve voice-to-text (VTT) and directly input text into office documents.

type MicrosoftWebOffice

type MicrosoftWebOffice struct {
	// contains filtered or unexported fields
}

MicrosoftWebOffice implements the ProductivityApp interface.

func NewMicrosoftWebOffice

func NewMicrosoftWebOffice(cr *chrome.Chrome, tconn *chrome.TestConn, uiHdl cuj.UIActionHandler, kb *input.KeyboardEventWriter, tabletMode bool, username, password string) *MicrosoftWebOffice

NewMicrosoftWebOffice creates MicrosoftWebOffice instance which implements ProductivityApp interface.

func (*MicrosoftWebOffice) Cleanup

func (app *MicrosoftWebOffice) Cleanup(ctx context.Context, sheetName string) error

Cleanup cleans up the resources used by running the Microsoft Web Office testing. It removes the document and slide which we created in the test case and close all tabs after completing the test. This function should be called as deferred function after the app is created.

func (*MicrosoftWebOffice) CreateDocument

func (app *MicrosoftWebOffice) CreateDocument(ctx context.Context) error

CreateDocument creates a new document from microsoft web app.

func (*MicrosoftWebOffice) CreateSlides

func (app *MicrosoftWebOffice) CreateSlides(ctx context.Context) error

CreateSlides creates a new presentation from microsoft web app.

func (*MicrosoftWebOffice) CreateSpreadsheet

func (app *MicrosoftWebOffice) CreateSpreadsheet(ctx context.Context, sampleSheetURL string) (string, error)

CreateSpreadsheet creates a new spreadsheet from the microsoft web app. and copy the content from the public shared document to return the sheet name. Since MS Office documents cannot directly copy view-only documents, we can only copy the contents of worksheets from public shared documents.

func (*MicrosoftWebOffice) MoveDataFromDocToSheet

func (app *MicrosoftWebOffice) MoveDataFromDocToSheet(ctx context.Context) error

MoveDataFromDocToSheet moves data from document to spreadsheet.

func (*MicrosoftWebOffice) MoveDataFromSheetToDoc

func (app *MicrosoftWebOffice) MoveDataFromSheetToDoc(ctx context.Context) error

MoveDataFromSheetToDoc moves data from spreadsheet to document.

func (*MicrosoftWebOffice) OpenSpreadsheet

func (app *MicrosoftWebOffice) OpenSpreadsheet(ctx context.Context, fileName string) (err error)

OpenSpreadsheet opens an existing spreadsheet from microsoft web app.

func (*MicrosoftWebOffice) ScrollPage

func (app *MicrosoftWebOffice) ScrollPage(ctx context.Context) error

ScrollPage scrolls the document and spreadsheet.

func (*MicrosoftWebOffice) SwitchToOfflineMode

func (app *MicrosoftWebOffice) SwitchToOfflineMode(ctx context.Context) error

SwitchToOfflineMode switches to offline mode.

func (*MicrosoftWebOffice) UpdateCells

func (app *MicrosoftWebOffice) UpdateCells(ctx context.Context) error

UpdateCells updates one of the independent cells and propagate values to dependent cells.

func (*MicrosoftWebOffice) VoiceToTextTesting

func (app *MicrosoftWebOffice) VoiceToTextTesting(ctx context.Context, expectedText string, playAudio action.Action) error

VoiceToTextTesting uses the "Dictation" function to achieve voice-to-text (VTT) and directly input text into office documents.

type ProductivityApp

type ProductivityApp interface {
	CreateDocument(ctx context.Context) error
	CreateSlides(ctx context.Context) error
	CreateSpreadsheet(ctx context.Context, sampleSheetURL string) (string, error)
	OpenSpreadsheet(ctx context.Context, filename string) error
	MoveDataFromDocToSheet(ctx context.Context) error
	MoveDataFromSheetToDoc(ctx context.Context) error
	ScrollPage(ctx context.Context) error
	SwitchToOfflineMode(ctx context.Context) error
	UpdateCells(ctx context.Context) error
	VoiceToTextTesting(ctx context.Context, expectedText string, playAudio action.Action) error
	Cleanup(ctx context.Context, sheetName string) error
}

ProductivityApp contains user's operation in productivity application.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL