Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Jelinek <djelinek@redhat.com>
  • Loading branch information
djelinek committed Oct 2, 2024
1 parent e716a34 commit 0ff6c9e
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 6 deletions.
23 changes: 23 additions & 0 deletions docs/ExtensionEditorDetailsSections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<img width="1512" alt="ExtensionEditorDetailsSections" src="https://github.com/user-attachments/assets/b795e36c-41b2-4251-9d2a-58585377dfe0">

#### Lookup

```typescript
import { ExtensionEditorDetailsSection } from 'vscode-extension-tester';
...
const extensionEditorDetails = new ExtensionEditorDetailsSection();
```

You can get values using following functions:

```typescript
await extensionEditorDetails.getCategories();

await extensionEditorDetails.getResources();

await extensionEditorDetails.getMoreInfo();

await extensionEditorDetails.getMoreInfoItem('Identifier');

await extensionEditorDetails.getReadme(); // currently not supported (Blocked by https://github.com/redhat-developer/vscode-extension-tester/issues/1492)
```
37 changes: 37 additions & 0 deletions docs/ExtensionEditorView.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<img width="1512" alt="ExtensionEditorView" src="https://github.com/user-attachments/assets/df5a4809-7fa6-4417-9024-a9a35b8257e4">

#### Lookup

```typescript
import { ExtensionEditorView } from 'vscode-extension-tester';
...
const extensionEditor = new ExtensionEditorView();
```

#### Get values from opened extension

You can get individual values using following functions:

```typescript
await extensionEditor.getName();

await extensionEditor.getVersion();

await extensionEditor.getPublisher();

await extensionEditor.getDescription();

await extensionEditor.getCount();
```

#### Manage tabs

Tabs section can be managed by this editor as well. For work with 'Details' you can use ExtensionEditorDetailsSection.

```typescript
await extensionEditor.getTabs();

await extensionEditor.switchToTab('tabname');

await extensionEditor.getActiveTab();
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { ExtensionEditorView } from '../..';
import { ExtensionEditorView, WebView } from '../..';

export class ExtensionEditorDetailsSection extends ExtensionEditorView {
/**
Expand Down Expand Up @@ -86,7 +86,7 @@ export class ExtensionEditorDetailsSection extends ExtensionEditorView {
/**
* Blocked by https://github.com/redhat-developer/vscode-extension-tester/issues/1492
*/
async getReadme(): Promise<Error> {
return Error('Not implemented yet.');
async getReadme(): Promise<WebView> {
throw Error('Not implemented yet.');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

import { Editor } from '../..';
import { Editor, EditorGroup, EditorView } from '../..';

export class ExtensionEditorView extends Editor {
constructor() {
super(undefined, ExtensionEditorView.locators.ExtensionEditorView.constructor);
constructor(view: EditorView | EditorGroup = new EditorView()) {
super(view, ExtensionEditorView.locators.ExtensionEditorView.constructor);
}

/**
Expand Down

0 comments on commit 0ff6c9e

Please sign in to comment.