fixed more repo= qs stuff
This commit is contained in:
parent
f73e1dbf66
commit
1a062650ad
|
@ -2383,8 +2383,9 @@ export function getPlatformAndRepo() {
|
||||||
var repo = getRepos()[repo_id];
|
var repo = getRepos()[repo_id];
|
||||||
// override query string params w/ repo settings
|
// override query string params w/ repo settings
|
||||||
if (repo) {
|
if (repo) {
|
||||||
|
console.log(platform_id, qs, repo);
|
||||||
qs.repo = repo_id;
|
qs.repo = repo_id;
|
||||||
if (repo.platform_id)
|
if (repo.platform_id && !qs.platform)
|
||||||
qs.platform = platform_id = repo.platform_id;
|
qs.platform = platform_id = repo.platform_id;
|
||||||
if (!qs.file && repo.mainPath)
|
if (!qs.file && repo.mainPath)
|
||||||
qs.file = repo.mainPath;
|
qs.file = repo.mainPath;
|
||||||
|
|
|
@ -9,8 +9,8 @@ var FILE = 'happy2020.c'
|
||||||
var PRESETFILE = 'hello.c'
|
var PRESETFILE = 'hello.c'
|
||||||
var QS_GITHUBURL = '&githubURL=https%3A%2F%2Fgithub.com%2F' + REPO
|
var QS_GITHUBURL = '&githubURL=https%3A%2F%2Fgithub.com%2F' + REPO
|
||||||
|
|
||||||
let github_config = JSON.parse(require('fs').readFileSync('./github.json','utf-8'));
|
try {
|
||||||
if (github_config?.token) {
|
var github_config = JSON.parse(require('fs').readFileSync('./github.json','utf-8'));
|
||||||
exports['beforeEach'] = function(browser) {
|
exports['beforeEach'] = function(browser) {
|
||||||
browser.setCookie({
|
browser.setCookie({
|
||||||
name: '__github_key',
|
name: '__github_key',
|
||||||
|
@ -18,8 +18,8 @@ if (github_config?.token) {
|
||||||
path: '/'
|
path: '/'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} catch (e) {
|
||||||
throw new Error('need ./github.js with {token:"..."}')
|
console.log('warning: need ./github.json with {token:"..."}')
|
||||||
}
|
}
|
||||||
|
|
||||||
exports['test import Github'] = async function (browser) {
|
exports['test import Github'] = async function (browser) {
|
||||||
|
@ -63,6 +63,14 @@ exports['test import Github'] = async function (browser) {
|
||||||
browser.expect.url().to.contain(`file=${FILE}`)
|
browser.expect.url().to.contain(`file=${FILE}`)
|
||||||
browser.expect.url().to.contain(`repo=${REPO.replace('/', '%2F')}`)
|
browser.expect.url().to.contain(`repo=${REPO.replace('/', '%2F')}`)
|
||||||
|
|
||||||
|
await browser.url(`${IDEURL}?platform=apple2`)
|
||||||
|
.waitForElementNotVisible('#error_alert')
|
||||||
|
.waitForElementVisible('#emuscreen')
|
||||||
|
.waitForElementVisible('.emuvideo')
|
||||||
|
|
||||||
|
browser.expect.url().to.contain(`platform=apple2`)
|
||||||
|
browser.expect.url().to.not.contain(`repo=${REPO.replace('/', '%2F')}`)
|
||||||
|
|
||||||
await browser.url(`${IDEURL}?platform=${PLATFORM}&file=${PRESETFILE}`)
|
await browser.url(`${IDEURL}?platform=${PLATFORM}&file=${PRESETFILE}`)
|
||||||
.waitForElementNotVisible('#error_alert')
|
.waitForElementNotVisible('#error_alert')
|
||||||
.waitForElementVisible('#emuscreen')
|
.waitForElementVisible('#emuscreen')
|
||||||
|
|
Loading…
Reference in New Issue