Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
podman-desktop-tester
Advanced tools
Playwright-based Testing framework for Podman Desktop and its extensions
Testing Framework dedicated to a Podman Desktop and its extensions.
nvm
)npm install
npm run build
npm run package
Extending afterEach Hook using custom TestContext In your project, you need to define the TestContext interface to be passed into extended hook
import type { TestContext } from 'vitest';
import { PodmanDesktopRunner } from 'podman-desktop-tester';
export interface RunnerTestContext extends TestContext {
pdRunner: PodmanDesktopRunner;
}
import type { RunnerTestContext } from '../testContext/runner-test-context';
import { afterEach } from 'vitest';
import { takeScreenshotHook } from 'podman-desktop-tester';
afterEach(async (context: RunnerTestContext) => {
context.onTestFailed(async () => await takeScreenshotHook(context.pdRunner, context.task.name));
});
Adding Global Setup/teardown module
import { removeFolderIfExists } from 'podman-desktop-tester';
let setupCalled = false;
let teardownCalled = false;
export async function setup() {
if (!setupCalled) {
// remove all previous testing output files
// Junit reporter output file is created before we can clean up output folders
// It is not possible to remove junit output file because it is opened by the process already, at least on windows
if (!process.env.CI) {
await removeFolderIfExists('tests/output');
} else {
console.log(
`On CI, skipping before All tests/output cleanup, see https://github.com/containers/podman-desktop/issues/5460`,
);
}
setupCalled = true;
}
}
export async function teardown() {
if (!teardownCalled) {
// here comes teardown logic
teardownCalled = true;
}
}
Example of the vitest test configuration file.
const config = {
test: {
globals: true,
globalSetup: './path/to/globalSetup/global-setup.ts',
setupFiles: './path/to/hooks/extended-hooks.ts',
/**
* By default, vitest search test files in all packages.
* For e2e tests have sense search only is project root tests folder
*/
include: ['**/tests/src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
exclude: [
'**/builtin/**',
'**/node_modules/**',
'**/dist/**',
'**/.{idea,git,cache,output,temp,cdix}/**',
'**/{.electron-builder,babel,changelog,docusaurus,jest,postcss,prettier,rollup,svelte,tailwind,vite,vitest*,webpack}.config.*',
],
/**
* A default timeout of 5000ms is sometimes not enough for playwright.
*/
testTimeout: 60_000,
hookTimeout: 120_000,
// test reporters - default for all and junit for CI
reporters: process.env.CI ? ['default', 'junit'] : ['verbose'],
outputFile: process.env.CI ? { junit: 'tests/output/junit-results.xml' } : {},
},
};
export default config;
Since you have your tests and testing frameworked at place, you can now run your tests from the repository.
You will to checkout podman-desktop repository and build it first.
git clone https://github.com/containers/podman-desktop
cd podman-desktop
yarn install
yarn test:e2e:build
-> this step is essentialThen you need to prepare your tests to be run from your repository
0. Add dependency for podman-desktop-tester
in devDependencies
"scripts": {
"test:e2e": "PODMAN_DESKTOP_ARGS='/path/to/podman-desktop' vitest run tests/src/ --pool=threads --poolOptions.threads.singleThread --poolOptions.threads.isolate --no-file-parallelism",
}
tests
foldernpm test:e2e
./tests/output
FAQs
Playwright-based Testing framework for Podman Desktop and its extensions
The npm package podman-desktop-tester receives a total of 0 weekly downloads. As such, podman-desktop-tester popularity was classified as not popular.
We found that podman-desktop-tester demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.