Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Aug 22, 2024
0 parents commit 7eb4c6a
Show file tree
Hide file tree
Showing 18 changed files with 725 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: ci
on:
push:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Fluent CI CLI
uses: fluentci-io/setup-fluentci@v5
with:
wasm: true
plugin: bun
args: |
install
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run e2e tests
run: |
fluentci run --wasm playwright install
fluentci run --wasm playwright test
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Microsoft Open Source Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).

Resources:

- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [[email protected]](mailto:[email protected]) with questions or concerns
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Microsoft Corporation.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# FluentCI CI demo for Playwright 🎭

[![ci](https://github.com/fluentci-demos/fluentci-demo-buck/actions/workflows/ci.yml/badge.svg)](https://github.com/fluentci-demos/fluentci-demo-buck/actions/workflows/ci.yml)

This repo is used to demonstrate various testing scenarios with [Playwright](https://playwright.dev/) 🎭 with Node.js using FluentCI.
70 changes: 70 additions & 0 deletions hars/25cc30e4a440111abd545551113b7bf2e2cad209.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[
{
"name": "Strawberry",
"id": 3
},
{
"name": "Banana",
"id": 1
},
{
"name": "Tomato",
"id": 5
},
{
"name": "Pear",
"id": 4
},
{
"name": "Blackberry",
"id": 64
},
{
"name": "Kiwi",
"id": 66
},
{
"name": "Pineapple",
"id": 10
},
{
"name": "Passionfruit",
"id": 70
},
{
"name": "Orange",
"id": 2
},
{
"name": "Raspberry",
"id": 23
},
{
"name": "Watermelon",
"id": 25
},
{
"name": "Lemon",
"id": 26
},
{
"name": "Mango",
"id": 27
},
{
"name": "Blueberry",
"id": 33
},
{
"name": "Apple",
"id": 6
},
{
"name": "Melon",
"id": 41
},
{
"name": "Lime",
"id": 44
}
]
81 changes: 81 additions & 0 deletions hars/fruits.har
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"log": {
"version": "1.2",
"creator": {
"name": "Playwright",
"version": "1.35.1"
},
"browser": {
"name": "chromium",
"version": "115.0.5790.24"
},
"entries": [
{
"startedDateTime": "2023-07-03T18:00:20.971Z",
"time": 0.903,
"request": {
"method": "GET",
"url": "https://demo.playwright.dev/api-mocking/api/v1/fruits",
"httpVersion": "HTTP/2.0",
"cookies": [],
"headers": [
{ "name": ":authority", "value": "demo.playwright.dev" },
{ "name": ":method", "value": "GET" },
{ "name": ":path", "value": "/api-mocking/api/v1/fruits" },
{ "name": ":scheme", "value": "https" },
{ "name": "accept", "value": "*/*" },
{ "name": "accept-encoding", "value": "gzip, deflate, br" },
{ "name": "accept-language", "value": "en-US" },
{ "name": "cache-control", "value": "max-age=0" },
{ "name": "referer", "value": "https://demo.playwright.dev/api-mocking/" },
{ "name": "sec-fetch-dest", "value": "empty" },
{ "name": "sec-fetch-mode", "value": "cors" },
{ "name": "sec-fetch-site", "value": "same-origin" },
{ "name": "user-agent", "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.5790.24 Safari/537.36" }
],
"queryString": [],
"headersSize": -1,
"bodySize": -1
},
"response": {
"status": 200,
"statusText": "",
"httpVersion": "HTTP/2.0",
"cookies": [],
"headers": [
{ "name": "accept-ranges", "value": "bytes" },
{ "name": "access-control-allow-origin", "value": "*" },
{ "name": "age", "value": "0" },
{ "name": "cache-control", "value": "max-age=600" },
{ "name": "content-length", "value": "762" },
{ "name": "content-type", "value": "application/octet-stream" },
{ "name": "date", "value": "Mon, 03 Jul 2023 18:00:21 GMT" },
{ "name": "etag", "value": "\"6495697c-2fa\"" },
{ "name": "expires", "value": "Mon, 03 Jul 2023 18:10:21 GMT" },
{ "name": "last-modified", "value": "Fri, 23 Jun 2023 09:44:28 GMT" },
{ "name": "server", "value": "GitHub.com" },
{ "name": "vary", "value": "Accept-Encoding" },
{ "name": "via", "value": "1.1 varnish" },
{ "name": "x-cache", "value": "MISS" },
{ "name": "x-cache-hits", "value": "0" },
{ "name": "x-fastly-request-id", "value": "d56d393516eeca913cb814d35726d5c0a7a84e52" },
{ "name": "x-github-request-id", "value": "C544:114C7:2BA884C:2D0CD20:64A30CB3" },
{ "name": "x-proxy-cache", "value": "MISS" },
{ "name": "x-served-by", "value": "cache-mad2200145-MAD" },
{ "name": "x-timer", "value": "S1688407221.077434,VS0,VE135" }
],
"content": {
"size": -1,
"mimeType": "application/octet-stream",
"_file": "25cc30e4a440111abd545551113b7bf2e2cad209.bin"
},
"headersSize": -1,
"bodySize": -1,
"redirectURL": ""
},
"cache": {},
"timings": { "send": -1, "wait": -1, "receive": 0.903 }
}
]
}
}
75 changes: 75 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "playwright-examples",
"version": "0.0.1",
"description": "This repo is used to demonstrate various testing scenarios with [Playwright](https://playwright.dev/) 🎭 with node.js",
"license": "Apache-2.0",
"devDependencies": {
"@playwright/test": "^1.45.0"
}
}
77 changes: 77 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});
Loading

0 comments on commit 7eb4c6a

Please sign in to comment.