Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
9c527ca
Fix broken banner image
HrithikDalal May 11, 2022
155918f
Update tested upto version to 6.1
Nov 14, 2022
cf641a4
Merge pull request #249 from rtCamp/update/tested_upto_version
juhi123 Nov 16, 2022
e4d79a5
Update rt-transcoder-admin.php
javmah Dec 7, 2022
36b1414
Revert "Update rt-transcoder-admin.php"
javmah Dec 7, 2022
9c5ced5
Add transcoder Test cases
alvitazwar Dec 7, 2022
f80abca
Addressed Feedback
alvitazwar Dec 11, 2022
9874d9b
Fix: Addressed Feedback and added missing scenarios
alvitazwar Dec 19, 2022
a7fd4fc
Check GH action
alvitazwar Dec 19, 2022
855e456
Update main.sh
pooja-muchandikar Dec 20, 2022
b0b244a
Update main.sh
pooja-muchandikar Dec 20, 2022
bdadf7d
Update main.sh
pooja-muchandikar Dec 20, 2022
8c0788f
Update main.sh
pooja-muchandikar Dec 20, 2022
abad204
Addressed Feedback with new test case
alvitazwar Dec 20, 2022
fc4f454
Update main.sh
pavanpatil1 Dec 20, 2022
68cf1ca
Update main.sh
pavanpatil1 Dec 20, 2022
4e36ee8
Update main.sh
pavanpatil1 Dec 20, 2022
9d4f71b
Update main.sh
pavanpatil1 Dec 20, 2022
6e28104
Update main.sh
pavanpatil1 Dec 20, 2022
fb1c713
Test GH Action
alvitazwar Dec 20, 2022
0997cbd
update site name
Dec 20, 2022
752583e
Update main.sh
pavanpatil1 Dec 20, 2022
64779b4
Complete Feedback without GH
alvitazwar Dec 20, 2022
9ea9f3c
Test GH Action
alvitazwar Dec 21, 2022
99961bd
Test GH Action
alvitazwar Dec 21, 2022
4d1dab4
Test GH Action
alvitazwar Dec 21, 2022
5a97950
Test GH Action
alvitazwar Dec 21, 2022
95f6165
Test GH Action
alvitazwar Dec 21, 2022
1f38bdb
Test GH Action
alvitazwar Dec 21, 2022
6d29f88
Test GH Action
alvitazwar Dec 21, 2022
94e205e
Test GH Action
alvitazwar Dec 21, 2022
5d77403
Test GH Action
alvitazwar Dec 21, 2022
931f75f
Test GH Action
alvitazwar Dec 21, 2022
a65e831
Test GH Action
alvitazwar Dec 21, 2022
444329f
Test GH Action
alvitazwar Dec 21, 2022
acccf76
Test GH Action
alvitazwar Dec 21, 2022
eb71c5e
Check Direct URL action
alvitazwar Dec 21, 2022
21e03a1
Check Direct URL action
alvitazwar Dec 21, 2022
6fa45c4
Check Direct URL action
alvitazwar Dec 21, 2022
19f6dd5
Check Direct URL action
alvitazwar Dec 22, 2022
894a8b8
Check E2E Test cases
alvitazwar Dec 22, 2022
ef9ffad
Check Tesult Integration
alvitazwar Dec 22, 2022
76f68e2
Check Tesult Integration
alvitazwar Dec 22, 2022
bce0ffb
Check Tesult Test Cases
alvitazwar Dec 22, 2022
4dca143
Implement cleaning after test execution
alvitazwar Dec 22, 2022
0b7f43d
Implement cleaning after test execution
alvitazwar Dec 22, 2022
67b518a
Implement cleaning after test execution
alvitazwar Dec 22, 2022
eae0f17
Implement cleaning after test execution
alvitazwar Dec 22, 2022
4a21033
Implement cleaning after test execution
alvitazwar Dec 22, 2022
f984d3a
Merge pull request #256 from rtCamp/action/directUrl
alvitazwar Dec 22, 2022
83acd86
Tesult Implementation
alvitazwar Dec 22, 2022
c662c68
Tesult Implementation
alvitazwar Dec 22, 2022
84de83b
Tesult Implementation
alvitazwar Dec 22, 2022
8bf17ca
Address final Feedback
alvitazwar Dec 23, 2022
ded1de4
Merge pull request #257 from rtCamp/automation/playwright
pooja-muchandikar Dec 23, 2022
a48df07
Fix CI run
alvitazwar Dec 23, 2022
b6d6980
Fix CI run
alvitazwar Dec 23, 2022
91c57c6
Fix CI run and clean files after testing
alvitazwar Dec 23, 2022
7c7c5d0
Merge pull request #258 from rtCamp/fix/ci-run
pooja-muchandikar Dec 26, 2022
1fd3569
Merge branch 'master' of github.com:rtCamp/transcoder into sync-dev-w…
Pathan-Amaankhan Feb 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# e2e test for transcoder

name: CI for Transcoder

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- master
- develop

pull_request:
branches:
- master
- develop

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
Run-wpe2e-TestCase:
# The type of runner that the job will run on
name: Run Transcoder Jobs
runs-on: ubuntu-latest
env:
SHA: ${{ github.event.pull_request.head.sha }}
COMMIT_SHA: ${{ github.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
working-directory: ./tests/e2e-playwright
TESRESULT_TOKEN: ${{ secrets.TESRESULT_TOKEN }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}


# Steps represent a sequence of tasks that will be executed as part of the job
steps:

- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 17
cache: "npm"
cache-dependency-path: tests/e2e-playwright/package-lock.json

- name: Install npm dependencies
run: npm install
working-directory: ${{env.working-directory}}

- name: Build Playwright utils dependencies
run: npm run build
working-directory: ${{env.working-directory}}

- name: Install browser
run: npx playwright install chromium
working-directory: ${{env.working-directory}}

- name: Run End to End tests
run: npm run test-e2e:playwright -- test
working-directory: ${{env.working-directory}}

- name: run PR status
if: ${{ always() }}
run: node ./tests/e2e-playwright/bin/pr-status.js
working-directory: ${{env.working_directory}}

- name: Make reports available
uses: actions/upload-artifact@v2
if: success() || failure()
with:
name: playwright-report
retention-days: 2
path: |
${{ github.workspace }}/playwright-report
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: rtcamp, mangeshp, chandrapatel, manishsongirkar36, bhargavbhandari
Tags: media, multimedia, audio, songs, music, video, ffmpeg, media-node, rtMedia, WordPress, kaltura, transcode, transcoder, encoding, encode
Donate link: https://rtcamp.com/donate/
Requires at least: 4.1
Tested up to: 5.8
Tested up to: 6.1
Stable tag: 1.3.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down
30 changes: 30 additions & 0 deletions tests/e2e-playwright/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# wp-e2e
This is a generic automation test suit using WP Gutenberg Playwright Utils
Used Framewrok
1. Playwright https://playwright.dev/
2. WordPress E2E Playwright Utils https://github.com/WordPress/gutenberg/tree/trunk/packages/e2e-test-utils-playwright

## Install
`npm install`

`npm run build`



## Run all available tests.
`npm run test-e2e:playwright`

## Run in headed mode.`
`npm run test-e2e:playwright -- --headed`

## Run a single test file.
`npm run test-e2e:playwright -- <path_to_test_file> # E.g., npm run test-e2e:playwright -- add-new-post.spec.js`

## Debugging
`npm run test-e2e:playwright -- --debug`

## Migration
We can migrate wp-e2e generic test cases from [here](https://github.com/rtCamp/wp-e2e/tree/master/specs) using the steps mentioned in [this](https://github.com/WordPress/gutenberg/pull/38570)



Binary file added tests/e2e-playwright/assets/3g2-sample.3g2
Binary file not shown.
Binary file added tests/e2e-playwright/assets/3gp-sample.3gp
Binary file not shown.
Binary file added tests/e2e-playwright/assets/mp3-sample.mp3
Binary file not shown.
Binary file added tests/e2e-playwright/assets/mp4-sample.mp4
Binary file not shown.
Binary file added tests/e2e-playwright/assets/ogg-sample.ogg
Binary file not shown.
Binary file added tests/e2e-playwright/assets/pdf-sample.pdf
Binary file not shown.
Binary file added tests/e2e-playwright/assets/webm-sample.webm
Binary file not shown.
199 changes: 199 additions & 0 deletions tests/e2e-playwright/bin/packages/build-worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
/**
* External dependencies
*/
const { promisify } = require( 'util' );
const fs = require( 'fs' );
const path = require( 'path' );
const babel = require( '@babel/core' );
const makeDir = require( 'make-dir' );
const sass = require( 'sass' );
const postcss = require( 'postcss' );
/**
* Internal dependencies
*/
const getBabelConfig = require( './get-babel-config' );

/**
* Path to packages directory.
*
* @type {string}
*/
const PACKAGES_DIR = path
.resolve( __dirname, '../../packages' )
.replace( /\\/g, '/' );

/**
* Mapping of JavaScript environments to corresponding build output.
*
* @type {Object}
*/
const JS_ENVIRONMENTS = {
main: 'build',
module: 'build-module',
};

/**
* Promisified fs.readFile.
*
* @type {Function}
*/
const readFile = promisify( fs.readFile );

/**
* Promisified fs.writeFile.
*
* @type {Function}
*/
const writeFile = promisify( fs.writeFile );

/**
* Promisified sass.render.
*
* @type {Function}
*/
const renderSass = promisify( sass.render );

/**
* Get the package name for a specified file
*
* @param {string} file File name.
*
* @return {string} Package name.
*/
function getPackageName( file ) {
return path.relative( PACKAGES_DIR, file ).split( path.sep )[ 0 ];
}

/**
* Get Build Path for a specified file.
*
* @param {string} file File to build.
* @param {string} buildFolder Output folder.
*
* @return {string} Build path.
*/
function getBuildPath( file, buildFolder ) {
const pkgName = getPackageName( file );
const pkgSrcPath = path.resolve( PACKAGES_DIR, pkgName, 'src' );
const pkgBuildPath = path.resolve( PACKAGES_DIR, pkgName, buildFolder );
const relativeToSrcPath = path.relative( pkgSrcPath, file );
return path.resolve( pkgBuildPath, relativeToSrcPath );
}

async function buildCSS( file ) {
const outputFile = getBuildPath(
file.replace( '.scss', '.css' ),
'build-style'
);
const outputFileRTL = getBuildPath(
file.replace( '.scss', '-rtl.css' ),
'build-style'
);

const [ , contents ] = await Promise.all( [
makeDir( path.dirname( outputFile ) ),
readFile( file, 'utf8' ),
] );

const importLists = [
'colors',
'breakpoints',
'variables',
'mixins',
'animations',
'z-index',
]
// Editor styles should be excluded from the default CSS vars output.
.concat(
file.includes( 'common.scss' ) || ! file.includes( 'block-library' )
? [ 'default-custom-properties' ]
: []
)
.map( ( imported ) => `@import "${ imported }";` )
.join( ' ' );

const builtSass = await renderSass( {
file,
includePaths: [ path.join( PACKAGES_DIR, 'base-styles' ) ],
data: ''.concat( '@use "sass:math";', importLists, contents ),
} );

const result = await postcss(
require( '@wordpress/postcss-plugins-preset' )
).process( builtSass.css, {
from: 'src/app.css',
to: 'dest/app.css',
} );

const resultRTL = await postcss( [ require( 'rtlcss' )() ] ).process(
result.css,
{
from: 'src/app.css',
to: 'dest/app.css',
}
);

await Promise.all( [
writeFile( outputFile, result.css ),
writeFile( outputFileRTL, resultRTL.css ),
] );
}

async function buildJS( file ) {
for ( const [ environment, buildDir ] of Object.entries(
JS_ENVIRONMENTS
) ) {
const destPath = getBuildPath(
file.replace( /\.tsx?$/, '.js' ),
buildDir
);
const babelOptions = getBabelConfig(
environment,
file.replace( PACKAGES_DIR, '@wordpress' )
);

const [ , transformed ] = await Promise.all( [
makeDir( path.dirname( destPath ) ),
babel.transformFileAsync( file, babelOptions ),
] );

await Promise.all( [
writeFile( destPath + '.map', JSON.stringify( transformed.map ) ),
writeFile(
destPath,
transformed.code +
'\n//# sourceMappingURL=' +
path.basename( destPath ) +
'.map'
),
] );
}
}

/**
* Object of build tasks per file extension.
*
* @type {Object<string,Function>}
*/
const BUILD_TASK_BY_EXTENSION = {
'.scss': buildCSS,
'.js': buildJS,
'.ts': buildJS,
'.tsx': buildJS,
};

module.exports = async ( file, callback ) => {
const extension = path.extname( file );
const task = BUILD_TASK_BY_EXTENSION[ extension ];

if ( ! task ) {
callback( new Error( `No handler for extension: ${ extension }` ) );
}

try {
await task( file );
callback();
} catch ( error ) {
callback( error );
}
};
Loading