Commit 8ea23e17 authored by Matthew Taylor's avatar Matthew Taylor Committed by GitHub

Merge pull request #1490 from LLK/release/2.2.24

[Master] Release 2.2.24
parents ee342dfb 38d79df8
......@@ -157,7 +157,7 @@ for (var v in routes) {
localizedAssetUrls[routes[v].name] = {};
var viewUrls = require(l10nStatic);
localizedAssetUrls[routes[v].name]['en'] = viewUrls;
localizedAssetUrls[routes[v].name]['en'] = viewUrls;
var defaultUrls = localizedUrls['en'];
for (var lang in languages) {
localizedAssetUrls[routes[v].name][lang] = {};
......@@ -192,7 +192,6 @@ async.forEachLimit(views, 5, function (view, cb) {
viewLocales['en'] = merge({}, generalLocales['en'], defaultLocales[view]);
// merge view specific english strings, first then other languages
process.stdout.write('Merging translations for ' + view + '\n');
async.forEach(allLangs, function (isoCode, cb) {
var translationsFile = path.resolve(
__dirname,
......@@ -204,8 +203,9 @@ async.forEachLimit(views, 5, function (view, cb) {
fs.readFile(translationsFile, 'utf8', function (err, data) {
if (err) {
if (err.code === 'ENOENT') {
// ignore missing files for english, Meow, and Edible Scratch
if (isoCode !== 'en') {
if (defaultLocales.hasOwnProperty(view)) {
if (isoCode !== 'cat' && isoCode !== 'yum' && defaultLocales.hasOwnProperty(view)) {
process.stdout.write('No translations for ' + view + ' ' + isoCode + ', using english\n');
}
viewLocales[isoCode] = merge({}, generalLocales[isoCode], defaultLocales[view]);
......@@ -224,8 +224,8 @@ async.forEachLimit(views, 5, function (view, cb) {
}
cb();
});
}, function (err) {
if (err) process.stdout.write('Error merging translations for view: ' + view + '\n' + err + '\n');
}, function (err) { // eslint-disable-line no-unused-vars
// ignore translation file errors, just keep going.
var viewTranslations = merge({}, viewLocales, localizedAssetUrls[view]);
writeIntlFile(outputDir, view, viewTranslations, function (err) {
if (err) {
......
This diff is collapsed.
......@@ -11,10 +11,10 @@
"about.quotes": "Quotes",
"about.quotesDescription": "The Scratch Team has received many emails from youth, parents, and educators expressing thanks for Scratch. Want to see what people are saying? You can read a collection of the <a href=\"/info/quotes\">quotes</a> we&#39;ve received.",
"about.learnMore": "Learn More About Scratch",
"about.learnMoreHelp": "Scratch Help Page",
"about.learnMoreHelp": "Tips Page",
"about.learnMoreFaq": "Frequently Asked Questions",
"about.learnMoreParents": "Information for Parents",
"about.learnMoreCredits": "Scratch Credits",
"about.learnMoreCredits": "Credits",
"about.literacy": "Learn to Code, Code to Learn",
"about.literacyDescription": "The ability to code computer programs is an important part of literacy in today’s society. When people learn to code in Scratch, they learn important strategies for solving problems, designing projects, and communicating ideas.",
"about.schools": "Scratch in Schools",
......
......@@ -28,8 +28,8 @@ var Credits = React.createClass({
</li>
<li>
<img src="//cdn.scratch.mit.edu/get_image/user/4598206_170x170.png" alt="Kasia Avatar" />
<span className="name">Kasia Chmielinski</span>
<img src="//cdn.scratch.mit.edu/get_image/user/900283_170x170.png" alt="Champika Avatar" />
<span className="name">Champika Fernando</span>
</li>
<li>
......@@ -51,11 +51,6 @@ var Credits = React.createClass({
<img src="//cdn.scratch.mit.edu/get_image/user/21986973_170x170.png" alt="Paul Avatar" />
<span className="name">Paul Kaplan</span>
</li>
<li>
<img src="//cdn.scratch.mit.edu/get_image/user/2752403_170x170.png" alt="Saskia Avatar" />
<span className="name">Saskia Leggett</span>
</li>
<li>
<img src="//cdn.scratch.mit.edu/get_image/user/527836_170x170.png" alt="DD Avatar" />
......@@ -136,6 +131,11 @@ var Credits = React.createClass({
<span className="name">Jolie Castellucci</span>
</li>
<li>
<img src="//cdn.scratch.mit.edu/get_image/user/24164779_170x170.png" alt="Ellen Avatar" />
<span className="name">Ellen Daoust</span>
</li>
<li>
<img src="//cdn.scratch.mit.edu/get_image/user/1048810_170x170.png" alt="Linda Avatar" />
<span className="name">Linda Fernsel</span>
......@@ -195,7 +195,6 @@ var Credits = React.createClass({
<p><FormattedHTMLMessage id='credits.acknowledgementsContributors' /></p>
<p><FormattedMessage id='credits.acknowledgementsCommunity' /></p>
<p><FormattedMessage id='credits.acknowledgementsInfluencers' /></p>
<h2><FormattedMessage id='credits.supportersTitle' /></h2>
<p><FormattedMessage id='credits.supportersFinancialHeader' /></p>
<p>
......@@ -239,7 +238,7 @@ var Credits = React.createClass({
<a href="https://www.docker.com/"> Docker</a>,
<a href="https://www.elastic.co/"> Elasticsearch</a>,
<a href="http://ganglia.sourceforge.net/"> Ganglia</a>,
<a href="gunicorn.org"> Gunicorn</a>,
<a href="http://gunicorn.org"> Gunicorn</a>,
<a href="https://jenkins-ci.org/"> Jenkins</a>,
<a href="http://www.linux.org/"> Linux</a>,
<a href="http://memcached.org/"> Memcached</a>,
......
......@@ -3,13 +3,13 @@
"credits.developers": "Scratch is designed and developed by the Lifelong Kindergarten Group at MIT Media Lab:",
"credits.moderators": "The team of Scratch moderators manages, supports, and improves the Scratch online community:",
"credits.previousTitle": "Previous MIT Scratch Team Members",
"credits.previousBody": "Many important contributions have been made by previous Scratch Team members, including John Maloney (who led software development for the first decade of Scratch), Andrés Monroy-Hernández (who led the development of the first Scratch community website), Ben Berg, Amos Blanton, Karen Brennan, Juanita Buitrago, Leo Burd, Gaia Carini, Michelle Chung, Shane Clements, Hannah Cole, Sayamindu Dasgupta, Margarita Dekoli, Evelyn Eastmond, Dave Feinberg, Champika Fernando, Chris Graves, Megan Haddadi, Christina Huang, Tony Hwang, Abdulrahman Idlbi, Randy Jou, Di Liu, Tim Mickel, Amon Millner, Ricarose Roque, Andrea Saxman, Jay Silver, Tammy Stern, Lis Sylvan, Claudia Urrea, and Oren Zuckerman.",
"credits.previousBody": "Many important contributions have been made by previous Scratch Team members, including John Maloney (who led software development for the first decade of Scratch), Andrés Monroy-Hernández (who led the development of the first Scratch community website), Ben Berg, Amos Blanton, Karen Brennan, Juanita Buitrago, Leo Burd, Gaia Carini, Kasia Chmielinski, Michelle Chung, Shane Clements, Hannah Cole, Sayamindu Dasgupta, Margarita Dekoli, Evelyn Eastmond, Dave Feinberg, Chris Graves, Megan Haddadi, Christina Huang, Tony Hwang, Abdulrahman Idlbi, Randy Jou, Saskia Leggett, Tim Mickel, Amon Millner, Ricarose Roque, Andrea Saxman, Jay Silver, Tammy Stern, Lis Sylvan, Claudia Urrea, and Oren Zuckerman",
"credits.partnersTitle": "Design and Development Partners",
"credits.partnersBody": "Paula Bontá and Brian Silverman, Playful Invention Company (who started contributing to the design of Scratch even before it was called Scratch).",
"credits.researchersTitle": "Scratch Researchers",
"credits.researchersBody": "<a href=\"https://scratch.mit.edu/info/research/\">Research on Scratch</a> is being conducted by members of the MIT Scratch Team and researchers at other universities, including Yasmin Kafai (who collaborated on the <a href=\"http://www.nsf.gov/awardsearch/showAward?AWD_ID=0325828\">initial NSF Scratch grant</a>) at the University of Pennsylvania Graduate School of Education, Karen Brennan (who leads the <a href=\"http://scratched.gse.harvard.edu/\">ScratchEd project</a>) at the Harvard Graduate School of Education, Benjamin Mako Hill at the University of Washington, Andrés Monroy Hernández at Microsoft Research, Mimi Ito and Crystle Martin at the University of California, Irvine, Quinn Burke at College of Charleston, Deborah Fields at Utah State University, and Kylie Peppler at Indiana University.",
"credits.acknowledgementsTitle": "Acknowledgements",
"credits.acknowledgementsContributors": "The following people have also contributed to the development and support of Scratch over the years: Susan Abend, Robbie Berg, Lauren Bessen, Keith Braadfladt, Susan Carillo, Will Denton, Nathan Dinsmore, Catherine Feldman, Jodi Finch, Ioana Fineberg, Rachel Garber, Chris Garrity, Cassy Gibbs, Brian Harvey, Roland Hebert, Tracy Ho, Benjamin Howe, Kapaya Katongo, Evan Karatzas, Christine Kim, Joren Lauwers, Mike Lee, Jeff Lieberman, Mark Loughridge, Kelly Liu, Anthony Lu, Danny Lutz, David Malan, Wayne Marshall, John McIntosh, Paul Medlock-Walton, Dongfang (Tian) Mi, Ximena Miranda, Jens Moenig, Evan Moore, Geetha Narayanan, Kate Nazemi, Liddy Nevile, Wing Ngan, Derek O'Connell, Tim Radvan, Karen Randall, Ian Reynolds, Miriam Ruiz, Chinua Shaw, Ed Shems, Cynthia Solomon, Daniel Strimpel, Kilmer Sweazy, John Henry Thompson, Ubong Ukoh, Vladimir Vuksan, Han Xu, and the many volunteer <a href=\"http://wiki.scratch.mit.edu/wiki/Translators\">Scratch Translators</a> from around the world.",
"credits.acknowledgementsContributors": "The following people have also contributed to the development and support of Scratch over the years: Susan Abend, Robbie Berg, Lauren Bessen, Keith Braadfladt, Susan Carillo, Will Denton, Nathan Dinsmore, Catherine Feldman, Jodi Finch, Ioana Fineberg, JT Galla, Rachel Garber, Chris Garrity, Cassy Gibbs, Brian Harvey, Roland Hebert, Tracy Ho, Benjamin Howe, Kapaya Katongo, Evan Karatzas, Christine Kim, Joren Lauwers, Mike Lee, Jeff Lieberman, Mark Loughridge, Kelly Liu, Anthony Lu, Danny Lutz, David Malan, Wayne Marshall, John McIntosh, Paul Medlock-Walton, Dongfang (Tian) Mi, Ximena Miranda, Jens Moenig, Evan Moore, Geetha Narayanan, Kate Nazemi, Liddy Nevile, Wing Ngan, Derek O'Connell, Tim Radvan, Karen Randall, Ian Reynolds, Miriam Ruiz, Chinua Shaw, Ed Shems, Cynthia Solomon, Daniel Strimpel, Kilmer Sweazy, John Henry Thompson, Ubong Ukoh, Vladimir Vuksan, Han Xu, and the many volunteer <a href=\"http://wiki.scratch.mit.edu/wiki/Translators\">Scratch Translators</a> from around the world.",
"credits.acknowledgementsCommunity": "We greatly appreciate all of the contributions by members of the worldwide Scratch community, who have shaped the direction of Scratch by sharing their projects, comments, and ideas.",
"credits.acknowledgementsInfluencers": "The ideas of Seymour Papert and Alan Kay have deeply inspired and influenced our work on Scratch.",
"credits.supportersTitle": "Supporting Organizations",
......
{
"download.title": "Scratch 2 Offline Editor",
"download.title": "Scratch 2.0 Offline Editor",
"download.intro": "You can install the Scratch 2.0 editor to work on projects without an internet connection. This version will work on Mac, Windows, and some versions of Linux (32 bit).",
"download.introMac": "<b>Note for Mac Users:</b> the latest version of Scratch 2.0 Offline requires Adobe Air 20. To upgrade to Adobe Air 20 manually, go <a href=\"https://get.adobe.com/air/\">here</a>.",
"download.installation": "Installation",
......
......@@ -13,11 +13,11 @@
"faq.makeGameTitle":"How do I make a game or animation with Scratch?",
"faq.makeGameBody":"Check out the <a href=\"/tips\">tips page</a> to see lots of ways to get started with Scratch. Or just <a href=\"/projects/editor/?tip_bar=getStarted\">dive in</a> to the project editor.",
"faq.requirementsTitle":"What are the system requirements for Scratch?",
"faq.requirementsBody":"To run Scratch 2, you need to be using (1) a Windows, ChromeOS, Mac, or Linux computer; (2) a version of <a href=\"https://get.adobe.com/flashplayer/\">Adobe Flash Player</a> released on or after June 15, 2016; (3) a relatively recent web browser: one of the latest two versions of <a href=\"http://google.com/chrome/\">Chrome</a> (Windows, ChromeOS, Mac or Linux), <a href=\"http://www.mozilla.org/firefox/new/\">Firefox</a> (Windows or Mac only), <a href=\"https://support.apple.com/downloads/safari\">Safari</a> (Mac only), <a href=\"https://www.microsoft.com/windows/microsoft-edge\">Edge</a> (Windows only), or <a href=\"https://www.microsoft.com/download/internet-explorer.aspx\">Internet Explorer 11</a> (Windows only). If your computer doesn’t meet these requirements, you can try downloading and installing <a href=\"/scratch_1.4\">Scratch 1.4</a>, which you can still use to share projects to the Scratch 2 website.",
"faq.requirementsBody":"To run Scratch 2.0, you need to be using (1) a Windows, ChromeOS, Mac, or Linux computer; (2) a version of <a href=\"https://get.adobe.com/flashplayer/\">Adobe Flash Player</a> released on or after June 15, 2016; (3) a relatively recent web browser: one of the latest two versions of <a href=\"http://google.com/chrome/\">Chrome</a> (Windows, ChromeOS, Mac or Linux), <a href=\"http://www.mozilla.org/firefox/new/\">Firefox</a> (Windows or Mac only), <a href=\"https://support.apple.com/downloads/safari\">Safari</a> (Mac only), <a href=\"https://www.microsoft.com/windows/microsoft-edge\">Edge</a> (Windows only), or <a href=\"https://www.microsoft.com/download/internet-explorer.aspx\">Internet Explorer 11</a> (Windows only). If your computer doesn’t meet these requirements, you can try downloading and installing <a href=\"/scratch_1.4\">Scratch 1.4</a>, which you can still use to share projects to the Scratch 2.0 website.",
"faq.offlineTitle":"Do you have a downloadable version so I can create and view projects offline?",
"faq.offlineBody":"The Scratch 2 offline editor allows you to create Scratch projects without an internet connection. You can download Scratch 2 from the <a href=\"/scratch2download/\">website</a>. You can also still use <a href=\"/scratch_1.4\">Scratch 1.4</a>. Note: You can have both Scratch 1.4 and 2 on your computer.",
"faq.offlineBody":"The Scratch 2.0 offline editor allows you to create Scratch projects without an internet connection. You can <a href=\"/scratch2download/\">download Scratch 2.0</a> from the website. You can also still use <a href=\"/scratch_1.4\">Scratch 1.4</a>. Note: You can have both Scratch 1.4 and 2.0 on your computer.",
"faq.uploadOldTitle":"Can I still upload projects created with older versions of Scratch to the website?",
"faq.uploadOldBody":"Yes - you can share or upload projects made with earlier versions of Scratch, and they will be visible and playable. (However, you can’t download projects made with or edited in later versions of Scratch and open them in earlier versions. For example, you can’t open a Scratch 2 project in <a href=\"/scratch_1.4\">Scratch 1.4</a>, because <a href=\"/scratch_1.4\">Scratch 1.4</a> doesn’t know how to read the .sb2 project file format.)",
"faq.uploadOldBody":"Yes - you can share or upload projects made with earlier versions of Scratch, and they will be visible and playable. (However, you can’t download projects made with or edited in later versions of Scratch and open them in earlier versions. For example, you can’t open a Scratch 2.0 project in <a href=\"/scratch_1.4\">Scratch 1.4</a>, because <a href=\"/scratch_1.4\">Scratch 1.4</a> doesn’t know how to read the .sb2 project file format.)",
"faq.recordVideoTitle":"Can I record a video of my Scratch project?",
"faq.recordVideoBody":"Yes, you can record a video of your Scratch project up to 60 seconds. In the Scratch editor, from the File menu, select \"Record Project Video.\" (You need to be signed in to see this option.) You can choose additional recording options (such as recording sound and mouse clicks) through the \"More Options\" menu. Then, run your project however you'd like. Once the recording is done, follow the instructions to download the file to your computer. Depending on what kind of computer you have, you may need to download another program like the <a href=\"http://www.videolan.org/vlc/index.html\">VLC Media Player</a> to play the file. This file will run on YouTube, Vimeo, and Facebook, but may need to be converted for other websites like Twitter or Tumblr.",
"faq.scratchCostTitle":"How much does Scratch cost? Do I need a license?",
......@@ -38,7 +38,7 @@
"faq.rentInfoTitle":"Does the Scratch Team sell or rent information about users of Scratch to anyone?",
"faq.rentInfoBody":"No.",
"faq.viewUnsharedTitle":"Can the Scratch Team view unshared projects on my 'My Stuff' page?",
"faq.viewUnsharedBody":"Since the Scratch Team is responsible for moderation, we have access to all content stored on the Scratch website - including unshared projects. If you prefer to work on projects in complete privacy, you can use either the <a href=\"/scratch2download\">Scratch 2 offline editor</a> or <a href=\"/scratch_1.4\">Scratch 1.4</a>.",
"faq.viewUnsharedBody":"Since the Scratch Team is responsible for moderation, we have access to all content stored on the Scratch website - including unshared projects. If you prefer to work on projects in complete privacy, you can use either the <a href=\"/scratch2download\">Scratch 2.0 offline editor</a> or <a href=\"/scratch_1.4\">Scratch 1.4</a>.",
"faq.remixDefinitionTitle":"What is a remix?",
"faq.remixDefinitionBody":"When a Scratcher makes a copy of someone else’s project and modifies it to add their own ideas (for example, by changing scripts or costumes), the resulting project is called a \"remix.\" Every project shared to the Scratch website can be remixed. We consider even a minor change to be a valid remix, as long as credit is given to the original project creator and others who made significant contributions to the remix.",
"faq.remixableTitle":"Why does the Scratch Team require that all projects be “remixable”?",
......@@ -138,5 +138,5 @@
"faq.dataBody":"When a student first signs up on Scratch, we ask for basic demographic data including gender, age (birth month and year), country, and an email address for verification. This data is used (in aggregated form) in research studies intended to improve our understanding of how people learn with Scratch. When an educator uses a Scratch Teacher Account to create student accounts in bulk, students are not required to provide an email address for account setup.",
"faq.lawComplianceTitle":"Is Scratch 2.0 (online version) compliant with United States local and federal data privacy laws?",
"faq.lawComplianceBody":"Scratch cares deeply about the privacy of students and of all individuals who use our platform. We have in place physical and electronic procedures to protect the information we collect on the Scratch website. Although we are not in a position to offer contractual guarantees with each entity that uses our free educational product, we are in compliance with all United States federal laws that are applicable to MIT, a 501(c)(3) organization and the entity that created and maintains Scratch. We encourage you to read the Scratch Privacy Policy for more information.",
"faq.schoolsMoreInfo":"For more more questions about Teacher Accounts, see the <a href=\"/educators/faq\">Teacher Account FAQ</a>"
"faq.schoolsMoreInfo":"For more questions about Teacher Accounts, see the <a href=\"/educators/faq\">Teacher Account FAQ</a>"
}
......@@ -13,5 +13,5 @@
"guidelines.honestybody": "Don’t try to impersonate other Scratchers, spread rumors, or otherwise try to trick the community.",
"guidelines.friendlyheader": "Help keep the site friendly.",
"guidelines.friendlybody": "If you think a project or comment is mean, insulting, too violent, or otherwise inappropriate, click “Report” to let us know about it.",
"guidelines.footer": "Scratch welcomes people of all ages, races, ethnicities, religions, sexual orientations, and gender identities."
"guidelines.footer": "Scratch welcomes people of all ages, races, ethnicities, religions, abilities, sexual orientations, and gender identities."
}
......@@ -30,6 +30,14 @@ var Jobs = React.createClass({
<div className="inner">
<h3><FormattedMessage id='jobs.openings' /></h3>
<ul>
<li>
<a href="/jobs/moderator">
Community Moderator (Remote)
</a>
<span>
MIT Media Lab, Cambridge, MA (or Remote)
</span>
</li>
<li>
<a href="https://www.media.mit.edu/about/job-opportunities/junior-web-designer-scratch/">
Junior Designer
......
......@@ -12,7 +12,7 @@
"teacherlanding.meetupTitle": "In-Person Gatherings",
"teacherlanding.meetupDescription": "<a href=\"http://www.meetup.com/pro/scratched/\">Scratch Educator Meetups</a> are gatherings of Scratch Educators who want to learn with and from each other, sharing their ideas and strategies for supporting computational creativity in all its forms.",
"teacherlanding.guidesTitle": "Guides & Tutorials",
"teacherlanding.tttPage": "The <a href=\"/go\">Things to Try page</a> offers a variety of tutorials, activity cards, and educator guides.",
"teacherlanding.tttPage": "The <a href=\"/tips\">Tips page</a> offers a variety of tutorials, activity cards, and educator guides.",
"teacherlanding.tipsWindow" : "The <a href=\"/projects/editor/?tip_bar=home\">Tips Window</a> provides help for creating projects in Scratch.",
"teacherlanding.creativeComputing": "The <a href=\"http://scratched.gse.harvard.edu/guide/\">Creative Computing Curriculum Guide</a> provides plans, activities, and strategies for introducing creative computing.",
"teacherlanding.accountsTitle": "Teacher Accounts in Scratch",
......
......@@ -84,8 +84,8 @@ var Landing = injectIntl(React.createClass({
<h3 id="guides-header"><FormattedMessage id="teacherlanding.guidesTitle" /></h3>
<FlexRow className="guides-and-tutorials">
<div>
<a href="/go">
<img src="/svgs/teachers/resources.svg" alt="resources icon" />
<a href="/tips">
<img src="/svgs/teachers/v2-cards.svg" alt="cards icon" />
</a>
<p>
<FormattedHTMLMessage id="teacherlanding.tttPage" />
......
......@@ -10,8 +10,8 @@
"wedo2.setupText": "Connect your WeDo 2.0 by following the steps in the <a href=\"/projects/editor/?tip_bar=ext2\">Tips Window</a>",
"wedo2.createTitle": "3. Create",
"wedo2.createText": "Use the WeDo extension blocks to turn on lights, control motors, and make your project interactive",
"wedo2.wedo2SetupInstructions": "Wedo 2.0 Setup Instructions",
"wedo2.wedo1SetupInstructions": "Wedo 1.0 Setup Instructions",
"wedo2.wedo2SetupInstructions": "WeDo 2.0 Setup Instructions",
"wedo2.wedo1SetupInstructions": "WeDo 1.0 Setup Instructions",
"wedo2.starterProjects": "WeDo 2.0 Starter Projects",
"wedo2.starterMotor": "Motor",
"wedo2.starterDistance": "Distance Sensor",
......
<svg xmlns="http://www.w3.org/2000/svg" width="140" height="116" viewBox="0 0 140 116"><title>resources</title><g style="isolation:isolate"><g id="Layer_1" data-name="Layer 1"><g opacity="0.4" style="mix-blend-mode:multiply"><path d="M97,44.18L91.25,62.24V81.16a2.45,2.45,0,0,1-2.44,2.45H84.43l-0.95,3a2.44,2.44,0,0,1-3.07,1.58L66.18,83.61h-15a2.45,2.45,0,0,1-2.44-2.45V78l-4.17-1.33A2.44,2.44,0,0,1,43,73.66l5.75-18v-19a2.44,2.44,0,0,1,2.44-2.44H73.85l17.4,5.55,4.17,1.33A2.45,2.45,0,0,1,97,44.18Z" fill="#bcbec0" stroke="#bcbec0" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/><path d="M91.25,36.66v3.11l-17.4-5.55h15A2.44,2.44,0,0,1,91.25,36.66Z" fill="#bcbec0" stroke="#bcbec0" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/></g><rect x="48.74" y="32.47" width="42.52" height="49.4" rx="2.12" ry="2.12" transform="translate(20.68 -18.57) rotate(17.69)" fill="#caa9ff" stroke="#824dcb" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/><rect x="48.74" y="32.47" width="42.52" height="49.4" rx="2.12" ry="2.12" fill="#caa9ff" stroke="#824dcb" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/><path d="M54.57,45.78H85.43a0,0,0,0,1,0,0V71.35a3,3,0,0,1-3,3H57.57a3,3,0,0,1-3-3V45.78A0,0,0,0,1,54.57,45.78Z" fill="#fff" stroke="#824dcb" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/><path d="M57.34,40H82.66a2.77,2.77,0,0,1,2.77,2.77v3a0,0,0,0,1,0,0H54.57a0,0,0,0,1,0,0v-3A2.77,2.77,0,0,1,57.34,40Z" fill="#824dcb" stroke="#824dcb" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/><polygon points="74.76 61.95 70 66.7 65.24 61.95 67.36 61.95 67.36 57.45 72.64 57.45 72.64 61.95 74.76 61.95" fill="#fff" stroke="#824dcb" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/><line x1="67.93" y1="54.53" x2="72.07" y2="54.53" fill="#fff" stroke="#824dcb" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/><line x1="68.88" y1="51.81" x2="71.12" y2="51.81" fill="#fff" stroke="#824dcb" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/></g></g></svg>
\ No newline at end of file
This diff is collapsed.
const webdriver = require('selenium-webdriver');
const driver = new webdriver.Builder()
.forBrowser('chrome')
.build();
const {By, until} = webdriver;
const findByXpath = (xpath) => {
return driver.wait(until.elementLocated(By.xpath(xpath), 5 * 1000));
};
const clickXpath = (xpath) => {
return findByXpath(xpath).then(el => el.click());
};
const clickText = (text) => {
return clickXpath(`//*[contains(text(), '${text}')]`);
};
const clickButton = (text) => {
return clickXpath(`//button[contains(text(), '${text}')]`);
};
const findByCss = (css) => {
return driver.wait(until.elementLocated(By.css(css), 1000 * 5));
};
const getLogs = (whitelist) => {
return driver.manage()
.logs()
.get('browser')
.then((entries) => {
return entries.filter((entry) => {
const message = entry.message;
for (let i = 0; i < whitelist.length; i++) {
if (message.indexOf(whitelist[i]) !== -1) {
// eslint-disable-next-line no-console
// console.warn('Ignoring whitelisted error: ' + whitelist[i]);
return false;
} else if (entry.level !== 'SEVERE') {
// eslint-disable-next-line no-console
// console.warn('Ignoring non-SEVERE entry: ' + message);
return false;
}
return true;
}
});
});
};
module.exports = {
webdriver,
By,
until,
driver,
clickXpath,
findByXpath,
clickText,
clickButton,
findByCss,
getLogs
};
......@@ -5,39 +5,27 @@
*
*/
const {
clickText,
findByXpath,
clickXpath,
clickButton,
driver,
until,
By
} = require('../../helpers/selenium-helpers.js');
var username = process.env.SMOKE_USERNAME;
var password = process.env.SMOKE_PASSWORD;
var tap = require('tap');
const test = tap.test;
const webdriver = require('selenium-webdriver');
const By = webdriver.By;
const until = webdriver.until;
const driver = new webdriver.Builder()
.forBrowser('chrome')
.build();
const findByXpath = (xpath) => {
return driver.wait(until.elementLocated(By.xpath(xpath), 5 * 1000));
};
const clickXpath = (xpath) => {
return findByXpath(xpath).then(el => el.click());
};
const clickText = (text) => {
return clickXpath(`//*[contains(text(), '${text}')]`);
};
const clickButton = (text) => {
return clickXpath(`//button[contains(text(), '${text}')]`);
};
var rootUrl = process.env.ROOT_URL || 'https://scratch.ly';
var url = rootUrl + '/users/anyuser';
tap.plan(5);
tap.plan(12);
tap.tearDown(function () {
driver.quit();
......@@ -47,6 +35,100 @@ tap.beforeEach(function () {
return driver.get(url);
});
/*
* This test fails sometimes because blank username eventually
* triggers the captcha page, which is a bug:
* https://github.com/LLK/scratchr2/issues/4762
*/
test('Trying to sign in with no username and no password using scratchr2 navbar', t => {
clickText('Sign in')
.then(() => clickButton('Sign in'))
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/button[@type="submit"]'))))
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/div[@class="error"]'))))
.then(() => findByXpath('//form/div[@class="error"]'))
.then((element) => element.getText())
.then((text) => t.match(text, 'This field is required.',
'"This field is required" error should be displayed'))
.then(() => t.end());
});
/*
* This test fails sometimes because blank username eventually
* triggers the captcha page, which is a bug:
* https://github.com/LLK/scratchr2/issues/4762
*/
test('Trying to sign in with no username using scratchr2 navbar', t => {
clickText('Sign in')
.then(() => findByXpath('//input[@name="password"]'))
.then((element) => element.sendKeys(password))
.then(() => clickButton('Sign in'))
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/button[@type="submit"]'))))
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/div[@class="error"]'))))
.then(() => findByXpath('//form/div[@class="error"]'))
.then((element) => element.getText())
.then((text) => t.match(text, 'This field is required.',
'"This field is required" error should be displayed'))
.then(() => t.end());
});
test('Trying to sign in with no password using scratchr2 navbar', t => {
var nonsenseusername = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5);
clickText('Sign in')
.then(() => findByXpath('//input[@id="login_dropdown_username"]'))
.then((element) => element.sendKeys(nonsenseusername))
.then(() => clickButton('Sign in'))
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/button[@type="submit"]'))))
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/div[@class="error"]'))))
.then(() => findByXpath('//form/div[@class="error"]'))
.then((element) => element.getText())
.then((text) => t.match(text, 'This field is required.',
'"This field is required" error should be displayed'))
.then(() => t.end());
});
test('Trying to sign in with the wrong username using scratchr2 navbar', t => {
var nonsenseusername = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5);
clickText('Sign in')
.then(() => findByXpath('//input[@id="login_dropdown_username"]'))
.then((element) => element.sendKeys(nonsenseusername))
.then(() => findByXpath('//input[@name="password"]'))
.then((element) => element.sendKeys(password))
.then(() => clickButton('Sign in'))
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/button[@type="submit"]'))))
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/div[@class="error"]'))))
.then(() => findByXpath('//form/div[@class="error"]'))
.then((element) => element.getText())
.then((text) => t.match(text, 'Incorrect username or password.',
'"Incorrect username or password" error should be displayed'))
.then(() => t.end());
});
test('Trying to sign in with the wrong password using scratchr2 navbar', t => {
clickText('Sign in')
.then(() => findByXpath('//input[@id="login_dropdown_username"]'))
.then((element) => element.sendKeys(username))
.then(() => findByXpath('//input[@name="password"]'))
.then((element) => element.sendKeys('nonsensepassword'))
.then(() => clickButton('Sign in'))
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/button[@type="submit"]'))))
.then(() => driver.wait(until
.elementLocated(By.xpath('//form[@id="login"]/div[@class="error"]'))))
.then(() => findByXpath('//form/div[@class="error"]'))
.then((element) => element.getText())
.then((text) => t.match(text, 'Incorrect username or password.',
'"Incorrect username or password" error should be displayed'))
.then(() => t.end());
});
test('Sign in to Scratch using scratchr2 navbar', t => {
clickText('Sign in')
.then(() => findByXpath('//input[@id="login_dropdown_username"]'))
......@@ -124,3 +206,30 @@ test('Add To button should bring up a list of studios', t => {
})
.then(() => t.end());
});
test('+ New Studio button should take you to the studio page', t => {
clickXpath('//a[@class="mystuff-icon"]')
.then(() => clickXpath('//form[@id="new_studio"]/button[@type="submit"]'))
.then(() => findByXpath('//div[@id="show-add-project"]'))
.then((element) => element.getText('span'))
.then((text) => t.equal(text, 'Add projects', 'there should be an "Add projects" button'))
.then(() => driver.getCurrentUrl())
.then( function (url) {
var expectedUrlRegExp = new RegExp('/studios/.*[0-9].*/?');
t.match(url, expectedUrlRegExp,
'after clicking the + New Studio, the URL should end in studios/STUDIO_ID');
})
.then(() => t.end());
});
test('+ New Project button should open the editor', t => {
clickXpath('//a[@class="mystuff-icon"]')
.then(() => clickText('+ New Project'))
.then(() => driver.getCurrentUrl())
.then( function (url) {
var expectedUrlRegExp = new RegExp('/projects/editor');
t.match(url, expectedUrlRegExp,
'after clicking, the URL should end in projects/editor');
})
.then(() => t.end());
});
/*
* Tests signing in according to smoke-tests at:
*
* https://github.com/LLK/scratchr2/wiki/Smoke-Testing-Test-Cases
*
*/
const {
clickText,
findByXpath,
clickXpath,
driver
} = require('../../helpers/selenium-helpers.js');
var username = process.env.SMOKE_USERNAME;
var password = process.env.SMOKE_PASSWORD;
var tap = require('tap');
const test = tap.test;
const webdriver = require('selenium-webdriver');
const By = webdriver.By;
const until = webdriver.until;
const driver = new webdriver.Builder()
.forBrowser('chrome')
.build();
const findByXpath = (xpath) => {
return driver.wait(until.elementLocated(By.xpath(xpath), 5 * 1000));
};
const clickXpath = (xpath) => {
return findByXpath(xpath).then(el => el.click());
};
const clickText = (text) => {
return clickXpath(`//*[contains(text(), '${text}')]`);
};
var rootUrl = process.env.ROOT_URL || 'https://scratch.ly';
......
/*
* Tests stats page according to smoke-tests at:
*
* https://github.com/LLK/scratchr2/wiki/Smoke-Testing-Test-Cases
*
*/
const {
clickText,
findByXpath,
findByCss,
driver
} = require('../../helpers/selenium-helpers.js');
var tap = require('tap');
const test = tap.test;
const webdriver = require('selenium-webdriver');
const By = webdriver.By;
const until = webdriver.until;
const driver = new webdriver.Builder()
.forBrowser('chrome')
.build();
const findByXpath = (xpath) => {
return driver.wait(until.elementLocated(By.xpath(xpath), 1000 * 5));
};
const findByCss = (css) => {
return driver.wait(until.elementLocated(By.css(css), 1000 * 5));
};
const clickXpath = (xpath) => {
return findByXpath(xpath).then(el => el.click());
};
const clickText = (text) => {
return clickXpath(`//*[contains(text(), '${text}')]`);
};
tap.plan(2);
......
var fs = require('fs');
var glob = require('glob');
var tap = require('tap');
var TRANSLATIONS_PATTERN = './node_modules/scratchr2_translations/www/**/*.json';
var files = glob.sync(TRANSLATIONS_PATTERN);
function checkJson (data, name) {
try {
JSON.parse(data);
} catch (e) {
tap.fail(name + ' has invalid Json.\n');
}
tap.pass();
}
files.forEach(function (f) {
tap.test('check valid json', function (t) {
fs.readFile(f, function (err, data) {
if (err) {
throw err;
}
checkJson(data, f);
});
t.end();
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment