js

package
v0.0.0-...-dd7c980 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const CONSOLE_LOG_CONTROL_STRING = "CC:" // for "complement-crypto"

Variables

This section is empty.

Functions

func NewJSClient

func NewJSClient(t ct.TestLike, opts api.ClientCreationOpts) (api.Client, error)

func SetupJSLogs

func SetupJSLogs(filename string)

func WriteJSLogs

func WriteJSLogs()

Types

type JSClient

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

func (*JSClient) Close

func (c *JSClient) Close(t ct.TestLike)

Close is called to clean up resources. Specifically, we need to shut off existing browsers and any FFI bindings. If we get callbacks/events after this point, tests may panic if the callbacks log messages.

func (*JSClient) CurrentAccessToken

func (c *JSClient) CurrentAccessToken(t ct.TestLike) string

func (*JSClient) DeletePersistentStorage

func (c *JSClient) DeletePersistentStorage(t ct.TestLike)

func (*JSClient) ForceClose

func (c *JSClient) ForceClose(t ct.TestLike)

func (*JSClient) GetNotification

func (c *JSClient) GetNotification(t ct.TestLike, roomID, eventID string) (*api.Notification, error)

func (*JSClient) IsRoomEncrypted

func (c *JSClient) IsRoomEncrypted(t ct.TestLike, roomID string) (bool, error)

IsRoomEncrypted returns true if the room is encrypted. May return an error e.g if you provide a bogus room ID.

func (*JSClient) LoadBackup

func (c *JSClient) LoadBackup(t ct.TestLike, recoveryKey string) error

func (*JSClient) Logf

func (c *JSClient) Logf(t ct.TestLike, format string, args ...interface{})

func (*JSClient) Login

func (c *JSClient) Login(t ct.TestLike, opts api.ClientCreationOpts) error

func (*JSClient) MustBackpaginate

func (c *JSClient) MustBackpaginate(t ct.TestLike, roomID string, count int)

func (*JSClient) MustBackupKeys

func (c *JSClient) MustBackupKeys(t ct.TestLike) (recoveryKey string)

func (*JSClient) MustGetEvent

func (c *JSClient) MustGetEvent(t ct.TestLike, roomID, eventID string) api.Event

func (*JSClient) MustLoadBackup

func (c *JSClient) MustLoadBackup(t ct.TestLike, recoveryKey string)

func (*JSClient) MustStartSyncing

func (c *JSClient) MustStartSyncing(t ct.TestLike) (stopSyncing func())

func (*JSClient) Opts

func (c *JSClient) Opts() api.ClientCreationOpts

func (*JSClient) SendMessage

func (c *JSClient) SendMessage(t ct.TestLike, roomID, text string) (eventID string)

SendMessage sends the given text as an m.room.message with msgtype:m.text into the given room.

func (*JSClient) StartSyncing

func (c *JSClient) StartSyncing(t ct.TestLike) (stopSyncing func(), err error)

StartSyncing to begin syncing from sync v2 / sliding sync. Tests should call stopSyncing() at the end of the test.

func (*JSClient) TrySendMessage

func (c *JSClient) TrySendMessage(t ct.TestLike, roomID, text string) (eventID string, err error)

func (*JSClient) Type

func (c *JSClient) Type() api.ClientTypeLang

func (*JSClient) UserID

func (c *JSClient) UserID() string

func (*JSClient) WaitUntilEventInRoom

func (c *JSClient) WaitUntilEventInRoom(t ct.TestLike, roomID string, checker func(e api.Event) bool) api.Waiter

type JSEvent

type JSEvent struct {
	Type     string                 `json:"type"`
	Sender   string                 `json:"sender,omitempty"`
	StateKey *string                `json:"state_key,omitempty"`
	Content  map[string]interface{} `json:"content"`
	ID       string                 `json:"event_id"`
}

Directories

Path Synopsis
package chrome provides helper functions to execute JS in a Chrome browser
package chrome provides helper functions to execute JS in a Chrome browser

Jump to

Keyboard shortcuts

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