In Plugwright, every test runs with a pre-configured context. You use test() to define a scenario and expect() to make assertions.
import { expect, test } from '@plugwright/runner';test('Basic test', async ({ player }) => { // Your test logic here});
Locators
Locators are your secret weapon. Plugwright allows you to precisely find and interact with GUIs, something no other framework does effectively!
test('Click an item in GUI', async ({ player }) => { player.chat('/openmenu'); // Wait for the GUI to open and get a live handle const gui = await player.gui({ title: 'Menu' }); // Find an item by its internal name or display name const shopItem = gui.locator(i => i.displayName.includes('Shop')); await shopItem.click(); await expect(player).toHaveReceivedMessage('You opened the shop!');});
Multi-Bot
Testing economy, trading, or PvP? You can easily spawn multiple bots to test interactions between players.