Skip to content
Snippets Groups Projects
Unverified Commit bc93a131 authored by Paul Kaplan's avatar Paul Kaplan Committed by GitHub
Browse files

Merge pull request #2580 from rschamp/bugfix/player-loader

Fix loading projects by hash on player example
parents 7073d01a 9bb65cd0
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ if (process.env.NODE_ENV === 'production' && typeof window === 'object') {
import styles from './player.css';
const Player = ({isPlayerOnly, onSeeInside}) => (
const Player = ({isPlayerOnly, onSeeInside, projectId}) => (
<Box
className={classNames({
[styles.stageOnly]: isPlayerOnly
......@@ -28,13 +28,15 @@ const Player = ({isPlayerOnly, onSeeInside}) => (
<GUI
enableCommunity
isPlayerOnly={isPlayerOnly}
projectId={projectId}
/>
</Box>
);
Player.propTypes = {
isPlayerOnly: PropTypes.bool,
onSeeInside: PropTypes.func
onSeeInside: PropTypes.func,
projectId: PropTypes.string
};
const mapStateToProps = state => ({
......
......@@ -44,6 +44,9 @@ class SeleniumHelper {
args.push('--headless');
}
chromeCapabilities.set('chromeOptions', {args});
chromeCapabilities.setLoggingPrefs({
performance: 'ALL'
});
this.driver = new webdriver.Builder()
.forBrowser('chrome')
.withCapabilities(chromeCapabilities)
......
......@@ -35,6 +35,14 @@ describe('player example', () => {
await clickXpath('//img[@title="Stop"]');
const logs = await getLogs();
await expect(logs).toEqual([]);
const projectRequests = await driver.manage().logs()
.get('performance')
.then(pLogs => pLogs.map(log => JSON.parse(log.message).message)
.filter(m => m.method === 'Network.requestWillBeSent')
.map(m => m.params.request.url)
.filter(url => url === 'https://projects.scratch.mit.edu/internalapi/project/96708228/get/')
);
await expect(projectRequests).toEqual(['https://projects.scratch.mit.edu/internalapi/project/96708228/get/']);
});
});
......@@ -58,6 +66,14 @@ describe('blocks example', () => {
await clickXpath('//img[@title="Stop"]');
const logs = await getLogs();
await expect(logs).toEqual([]);
const projectRequests = await driver.manage().logs()
.get('performance')
.then(pLogs => pLogs.map(log => JSON.parse(log.message).message)
.filter(m => m.method === 'Network.requestWillBeSent')
.map(m => m.params.request.url)
.filter(url => url === 'https://projects.scratch.mit.edu/internalapi/project/96708228/get/')
);
await expect(projectRequests).toEqual(['https://projects.scratch.mit.edu/internalapi/project/96708228/get/']);
});
test('Change categories', async () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment